/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('computenest', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CommodityValue = {
  result?: {
    order?: {
      currency?: string(name='Currency', description='货币代码。', example='CNY'),
      tradeAmount?: string(name='TradeAmount', description='优惠后。', example='9.99'),
      discountAmount?: string(name='DiscountAmount', description='抵扣金额。', example='1.99'),
      originalAmount?: string(name='OriginalAmount', description='优惠前。', example='11.98'),
    }(name='Order', description='订单信息。'),
    inquiryType?: string(name='InquiryType', description='询价类型，可选值：
1. Buy：新购询价。
2. ModificationBuy：变配询价。', example='Buy'),
    subOrders?: {
      subOrder?: [ 
        {
          moduleInstance?: [ 
            {
              moduleId?: long(name='ModuleId', description='模块ID。', example='1234'),
              moduleName?: string(name='ModuleName', description='模块名称。', example='Rds'),
              moduleCode?: string(name='ModuleCode', description='模块代码。', example='rds_dbtype'),
              totalProductFee?: double(name='TotalProductFee', description='产品原价（元）。', example='10.00'),
              discountFee?: double(name='DiscountFee', description='折扣费用（元）。', example='1.99'),
              payFee?: double(name='PayFee', description='实付金额（元）。', example='8.01'),
              priceUnit?: string(name='PriceUnit', description='价格单位。', example='元/GB/小时'),
              isPricingModule?: boolean(name='IsPricingModule', description='是否计价项。', example='true'),
              needOrderPay?: boolean(name='NeedOrderPay', description='在订单中是否需要支付。', example='true'),
              priceType?: string(name='PriceType', description='定价类型。', example='hourPrice'),
              moduleAttrs?: [ 
                {
                  type?: long(name='Type', description='属性类型，可选值：

1. 1：商品属性 
2. 2：规格属性 
3. 3：模块属性 
4. 4：外部参数（备用）', example='3'),
                  name?: string(name='Name', description='Name', example='20GB'),
                  code?: string(name='Code', description='Module attr code', example='rds_storage'),
                  value?: string(name='Value', description='Value', example='20'),
                  unit?: string(name='Unit', description='Unit', example='GB'),
                }
              ](name='ModuleAttrs', description='模块属性。'),
            }
          ](name='ModuleInstance', description='模块（实例）信息。'),
        }
      ](name='SubOrder', description='订单子项。'),
    }(name='SubOrders', description='订单子项。'),
    coupons?: [ 
      {
        canPromFee?: double(name='CanPromFee', description='可支付金额。', example='9.99'),
        couponDesc?: string(name='CouponDesc', description='Coupon Description', example='10元优惠券（有效期至2024年9月8日）'),
        couponName?: string(name='CouponName', description='Coupon Name', example='10元优惠券'),
        couponOptionNo?: string(name='CouponOptionNo', description='Coupon OptionNo', example='50008800000xxxx'),
        selected?: boolean(name='Selected', description='是否选中。', example='true'),
      }
    ](name='Coupons', description='优惠券。'),
  }(name='Result', description='Result模型。'),
}

model CancelServiceUsageRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  needDelete?: boolean(name='NeedDelete', description='Specifies whether to delete the application.

>  After you delete the application, you must re-enter the application information the next time you submit an application.', example='true'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-d6fc5f949a9246xxxxxx'),
}

model CancelServiceUsageResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model CancelServiceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelServiceUsageResponseBody(name='body'),
}

/**
 * @summary Cancels the application for using a service.
 *
 * @param request CancelServiceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelServiceUsageResponse
 */
async function cancelServiceUsageWithOptions(request: CancelServiceUsageRequest, runtime: $RuntimeOptions): CancelServiceUsageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.needDelete)) {
    query['NeedDelete'] = request.needDelete;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelServiceUsage',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels the application for using a service.
 *
 * @param request CancelServiceUsageRequest
 * @return CancelServiceUsageResponse
 */
async function cancelServiceUsage(request: CancelServiceUsageRequest): CancelServiceUsageResponse {
  var runtime = new $RuntimeOptions{};
  return cancelServiceUsageWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group.

You can view resource group IDs in the [Resource Management console](https://resourcemanager.console.aliyun.com/resource-groups) .', example='rg-acfmzmhzo******'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the cloud resource that you want to move to a new resource group.', example='si-5dc794a7fd254e******'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance', example='service'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='464C8CB6-A548-5206-B83C-D32A8E43EC21'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which a cloud resource belongs.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: $RuntimeOptions): ChangeResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeResourceGroup',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the resource group to which a cloud resource belongs.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CheckServiceDeployableRequest {
  postPaidAmount?: string(name='PostPaidAmount', description='Total amount of postpaid.', example='1.29'),
  prePaidAmount?: string(name='PrePaidAmount', description='Total amount of prepayment.', example='0.0'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-0e6fca6a51a544xxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  trialType?: string(name='TrialType', description='The trial type of the service instance. Valid values:

*   **Trial**: Trials are supported.
*   **NotTrial**: Trials are not supported.', example='NotTrial'),
}

model CheckServiceDeployableResponseBody = {
  checkResults?: [ 
    {
      message?: string(name='Message', description='Returns a hint message for the result.', example='""'),
      type?: string(name='Type', description='Check type, invalid values:

- Balance ：Account balance.

- Quota:  Account quota.', example='Balance'),
      value?: string(name='Value', description='Inspection result.', example='true'),
    }
  ](name='CheckResults', description='Inspection result.'),
  requestId?: string(name='RequestId', description='Id of the request', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model CheckServiceDeployableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckServiceDeployableResponseBody(name='body'),
}

/**
 * @summary 服务实例部署前的预检查
 *
 * @param request CheckServiceDeployableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckServiceDeployableResponse
 */
async function checkServiceDeployableWithOptions(request: CheckServiceDeployableRequest, runtime: $RuntimeOptions): CheckServiceDeployableResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.postPaidAmount)) {
    query['PostPaidAmount'] = request.postPaidAmount;
  }
  if (!$isNull(request.prePaidAmount)) {
    query['PrePaidAmount'] = request.prePaidAmount;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckServiceDeployable',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 服务实例部署前的预检查
 *
 * @param request CheckServiceDeployableRequest
 * @return CheckServiceDeployableResponse
 */
async function checkServiceDeployable(request: CheckServiceDeployableRequest): CheckServiceDeployableResponse {
  var runtime = new $RuntimeOptions{};
  return checkServiceDeployableWithOptions(request, runtime);
}

model ContinueDeployServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request to check information such as the permissions and instance status. Valid values:

*   true: performs a dry run for the request, but does not create a service instance.
*   false: performs a dry run for the request, and creates a service instance if the request passes the dry run.', example='false'),
  option?: [ string ](name='Option', description='The options that the system adopts when the system continues to create the service instance.'),
  parameters?: string(name='Parameters', description='The parameters configured for the service instance.', example='{"NodeCount": 3, "SystemDiskSize": 40, "InstancePassword": "******"}'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-0e6fca6a51a54420****'),
}

model ContinueDeployServiceInstanceResponseBody = {
  dryRunResult?: {
    parametersAllowedToBeModified?: [ string ](name='ParametersAllowedToBeModified', description='The parameters that can be modified. The operation that is performed to modify the parameters does not cause a validation error.

> This parameter is returned only if DryRun is set to true.'),
    parametersConditionallyAllowedToBeModified?: [ string ](name='ParametersConditionallyAllowedToBeModified', description='The parameters that can be modified under specific conditions. The new values of the parameters determine whether the operation that is performed to modify the parameters causes a validation error.

> This parameter is returned only if DryRun is set to true.'),
    parametersNotAllowedToBeModified?: [ string ](name='ParametersNotAllowedToBeModified', description='The parameters that cannot be modified. The operation that is performed to modify the parameters causes a validation error.

> This parameter is returned only if DryRun is set to true.'),
  }(name='DryRunResult', description='The dry run result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4b17****'),
}

model ContinueDeployServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ContinueDeployServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Continues to deploy a service instance after the service instance failed to be deployed.
 *
 * @description This operation is available only for service instances that belong to private services deployed by using Resource Orchestration Service (ROS).
 *
 * @param request ContinueDeployServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ContinueDeployServiceInstanceResponse
 */
async function continueDeployServiceInstanceWithOptions(request: ContinueDeployServiceInstanceRequest, runtime: $RuntimeOptions): ContinueDeployServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.option)) {
    query['Option'] = request.option;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ContinueDeployServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Continues to deploy a service instance after the service instance failed to be deployed.
 *
 * @description This operation is available only for service instances that belong to private services deployed by using Resource Orchestration Service (ROS).
 *
 * @param request ContinueDeployServiceInstanceRequest
 * @return ContinueDeployServiceInstanceResponse
 */
async function continueDeployServiceInstance(request: ContinueDeployServiceInstanceRequest): ContinueDeployServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return continueDeployServiceInstanceWithOptions(request, runtime);
}

model CreateServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  commodity?: {
    autoPay?: boolean(name='AutoPay', description='Specifies whether to automatically complete the payment. Valid values:

*   **true**
*   **false**', example='false'),
    autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the service instance. Valid values:

*   **true**
*   **false**', example='false'),
    couponId?: string(name='CouponId', description='The coupon ID.', example='302070970220'),
    payPeriod?: long(name='PayPeriod', description='The subscription duration.', example='1'),
    payPeriodUnit?: string(name='PayPeriodUnit', description='The unit of the subscription duration. Valid values:

*   **Year**
*   **Month**
*   **Day**', example='Year'),
  }(name='Commodity', description='The information about the order placed in Alibaba Cloud Marketplace. You do not need to specify this parameter if the service is not published in Alibaba Cloud Marketplace or uses the pay-as-you-go billing method.'),
  contactGroup?: string(name='ContactGroup', description='The alert contact group.', example='Default Group'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request to check information such as the permissions and instance status. Valid values:

*   **true**: performs a dry run for the request, but does not create a service instance.
*   **false**: performs a dry run for the request, and creates a service instance if the request passes the dry run.', example='false'),
  enableInstanceOps?: boolean(name='EnableInstanceOps', description='Specifies whether the service instance supports the hosted O\\\\&M feature. Valid values:

*   **true**
*   **false**', example='true'),
  enableUserPrometheus?: boolean(name='EnableUserPrometheus', description='Specifies whether to enable the Prometheus monitoring feature. Valid values:

*   **true**
*   **false**', example='true'),
  name?: string(name='Name', description='The serviceInstance name.', example='TestName'),
  operationMetadata?: {
    endTime?: string(name='EndTime', description='The operation end time.', example='2022-01-28T06:48:56Z'),
    extraInfo?: string(name='ExtraInfo', description='The additional information.', example='```json
  {
    "vncInfo": [
      {
        "instanceId": "i-001",
        "username": "admin",
        "password": "******",
        "vncPassword": "******"
      }
    ]
  }
  ```'),
    resources?: string(name='Resources', description='Imported resource.', example='{   "RegionId": "cn-hangzhou",   "Type": "ResourceIds",   "ResourceIds": {     "ALIYUN::ECS::INSTANCE": ["i-xxx", "i-yyy"],     "ALIYUN::RDS::INSTANCE": ["rm-xxx", "rm-yyy"],     "ALIYUN::VPC::VPC": ["vpc-xxx", "vpc-yyy"],     "ALIYUN::SLB::INSTANCE": ["lb-xxx", "lb-yyy"]   } }'),
    serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4b17****'),
    startTime?: string(name='StartTime', description='The operation start time.', example='2021-12-29T06:48:56Z'),
  }(name='OperationMetadata', description='The operation metadata.'),
  parameters?: map[string]any(name='Parameters', description='The parameters that the customer specifies to deploy the service instance.

>  If region information is required to create a service instance, you must specify the region ID in the value of Parameters.', example='{"NodeCount": 3, "SystemDiskSize": 40, "InstancePassword": "******"}'),
  regionId?: string(name='RegionId', description='The region ID. Valid values:

*   cn-hangzhou: China (Hangzhou).
*   ap-southeast-1: Singapore.

This parameter is required.', example='cn-hangzhou'),
  resourceAutoPay?: boolean(name='ResourceAutoPay', description='Specifies whether to automatically deduct the resource fees from the account balance. Valid values:

*   **true**
*   **false**', example='true'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-bp67acfmxazb4p****'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-0e6fca6a51a54420****'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  specificationCode?: string(name='SpecificationCode', description='Specification code.', example='yuncode5425200001'),
  specificationName?: string(name='SpecificationName', description='The package name.', example='Default Ppackage'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tags.'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='ECS Template'),
  trialType?: string(name='TrialType', description='The trial type of the service instance. Valid values:

*   **Trial**: Trials are supported.
*   **NotTrial**: Trials are not supported.', example='Trial'),
}

model CreateServiceInstanceShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  commodity?: {
    autoPay?: boolean(name='AutoPay', description='Specifies whether to automatically complete the payment. Valid values:

*   **true**
*   **false**', example='false'),
    autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal for the service instance. Valid values:

*   **true**
*   **false**', example='false'),
    couponId?: string(name='CouponId', description='The coupon ID.', example='302070970220'),
    payPeriod?: long(name='PayPeriod', description='The subscription duration.', example='1'),
    payPeriodUnit?: string(name='PayPeriodUnit', description='The unit of the subscription duration. Valid values:

*   **Year**
*   **Month**
*   **Day**', example='Year'),
  }(name='Commodity', description='The information about the order placed in Alibaba Cloud Marketplace. You do not need to specify this parameter if the service is not published in Alibaba Cloud Marketplace or uses the pay-as-you-go billing method.'),
  contactGroup?: string(name='ContactGroup', description='The alert contact group.', example='Default Group'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request to check information such as the permissions and instance status. Valid values:

*   **true**: performs a dry run for the request, but does not create a service instance.
*   **false**: performs a dry run for the request, and creates a service instance if the request passes the dry run.', example='false'),
  enableInstanceOps?: boolean(name='EnableInstanceOps', description='Specifies whether the service instance supports the hosted O\\\\&M feature. Valid values:

*   **true**
*   **false**', example='true'),
  enableUserPrometheus?: boolean(name='EnableUserPrometheus', description='Specifies whether to enable the Prometheus monitoring feature. Valid values:

*   **true**
*   **false**', example='true'),
  name?: string(name='Name', description='The serviceInstance name.', example='TestName'),
  operationMetadata?: {
    endTime?: string(name='EndTime', description='The operation end time.', example='2022-01-28T06:48:56Z'),
    extraInfo?: string(name='ExtraInfo', description='The additional information.', example='```json
  {
    "vncInfo": [
      {
        "instanceId": "i-001",
        "username": "admin",
        "password": "******",
        "vncPassword": "******"
      }
    ]
  }
  ```'),
    resources?: string(name='Resources', description='Imported resource.', example='{   "RegionId": "cn-hangzhou",   "Type": "ResourceIds",   "ResourceIds": {     "ALIYUN::ECS::INSTANCE": ["i-xxx", "i-yyy"],     "ALIYUN::RDS::INSTANCE": ["rm-xxx", "rm-yyy"],     "ALIYUN::VPC::VPC": ["vpc-xxx", "vpc-yyy"],     "ALIYUN::SLB::INSTANCE": ["lb-xxx", "lb-yyy"]   } }'),
    serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4b17****'),
    startTime?: string(name='StartTime', description='The operation start time.', example='2021-12-29T06:48:56Z'),
  }(name='OperationMetadata', description='The operation metadata.'),
  parametersShrink?: string(name='Parameters', description='The parameters that the customer specifies to deploy the service instance.

>  If region information is required to create a service instance, you must specify the region ID in the value of Parameters.', example='{"NodeCount": 3, "SystemDiskSize": 40, "InstancePassword": "******"}'),
  regionId?: string(name='RegionId', description='The region ID. Valid values:

*   cn-hangzhou: China (Hangzhou).
*   ap-southeast-1: Singapore.

This parameter is required.', example='cn-hangzhou'),
  resourceAutoPay?: boolean(name='ResourceAutoPay', description='Specifies whether to automatically deduct the resource fees from the account balance. Valid values:

*   **true**
*   **false**', example='true'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-bp67acfmxazb4p****'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-0e6fca6a51a54420****'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  specificationCode?: string(name='SpecificationCode', description='Specification code.', example='yuncode5425200001'),
  specificationName?: string(name='SpecificationName', description='The package name.', example='Default Ppackage'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tags.'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='ECS Template'),
  trialType?: string(name='TrialType', description='The trial type of the service instance. Valid values:

*   **Trial**: Trials are supported.
*   **NotTrial**: Trials are not supported.', example='Trial'),
}

model CreateServiceInstanceResponseBody = {
  marketInstanceId?: string(name='MarketInstanceId', description='The MartketInstance ID.', example='786***45'),
  orderId?: string(name='OrderId', description='The order ID.', example='2306175xxxxxxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D****'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-d6ab3a63ccbb4b17****'),
  status?: string(name='Status', description='The status of the service instance. Valid values:

*   **Created**
*   **Deploying**
*   **DeployedFailed**
*   **Deployed**
*   **Upgrading**
*   **Deleting**
*   **Deleted**
*   **DeletedFailed**', example='Created'),
}

model CreateServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Creates and deploys a service instance.
 *
 * @param tmpReq CreateServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceInstanceResponse
 */
async function createServiceInstanceWithOptions(tmpReq: CreateServiceInstanceRequest, runtime: $RuntimeOptions): CreateServiceInstanceResponse {
  tmpReq.validate();
  var request = new CreateServiceInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.commodity)) {
    query['Commodity'] = request.commodity;
  }
  if (!$isNull(request.contactGroup)) {
    query['ContactGroup'] = request.contactGroup;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.enableInstanceOps)) {
    query['EnableInstanceOps'] = request.enableInstanceOps;
  }
  if (!$isNull(request.enableUserPrometheus)) {
    query['EnableUserPrometheus'] = request.enableUserPrometheus;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.operationMetadata)) {
    query['OperationMetadata'] = request.operationMetadata;
  }
  if (!$isNull(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceAutoPay)) {
    query['ResourceAutoPay'] = request.resourceAutoPay;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.specificationCode)) {
    query['SpecificationCode'] = request.specificationCode;
  }
  if (!$isNull(request.specificationName)) {
    query['SpecificationName'] = request.specificationName;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates and deploys a service instance.
 *
 * @param request CreateServiceInstanceRequest
 * @return CreateServiceInstanceResponse
 */
async function createServiceInstance(request: CreateServiceInstanceRequest): CreateServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createServiceInstanceWithOptions(request, runtime);
}

model CreateServiceUsageRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-d6fc5f949a9246xxxxxx'),
  userInformation?: map[string]string(name='UserInformation', description='The application information.'),
}

model CreateServiceUsageShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-d6fc5f949a9246xxxxxx'),
  userInformationShrink?: string(name='UserInformation', description='The application information.'),
}

model CreateServiceUsageResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model CreateServiceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceUsageResponseBody(name='body'),
}

/**
 * @summary Creates an application for using a service.
 *
 * @param tmpReq CreateServiceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceUsageResponse
 */
async function createServiceUsageWithOptions(tmpReq: CreateServiceUsageRequest, runtime: $RuntimeOptions): CreateServiceUsageResponse {
  tmpReq.validate();
  var request = new CreateServiceUsageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.userInformation)) {
    request.userInformationShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userInformation, 'UserInformation', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.userInformationShrink)) {
    query['UserInformation'] = request.userInformationShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateServiceUsage',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application for using a service.
 *
 * @param request CreateServiceUsageRequest
 * @return CreateServiceUsageResponse
 */
async function createServiceUsage(request: CreateServiceUsageRequest): CreateServiceUsageResponse {
  var runtime = new $RuntimeOptions{};
  return createServiceUsageWithOptions(request, runtime);
}

model DeleteServiceInstancesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: [ string ](name='ServiceInstanceId', description='The IDs of the service instances.

This parameter is required.'),
}

model DeleteServiceInstancesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model DeleteServiceInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServiceInstancesResponseBody(name='body'),
}

/**
 * @summary Delete service instances.
 *
 * @param request DeleteServiceInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServiceInstancesResponse
 */
async function deleteServiceInstancesWithOptions(request: DeleteServiceInstancesRequest, runtime: $RuntimeOptions): DeleteServiceInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteServiceInstances',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete service instances.
 *
 * @param request DeleteServiceInstancesRequest
 * @return DeleteServiceInstancesResponse
 */
async function deleteServiceInstances(request: DeleteServiceInstancesRequest): DeleteServiceInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return deleteServiceInstancesWithOptions(request, runtime);
}

model DeployServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='Ensures idempotency of the request. Generate a unique value for this parameter from your client to ensure it is unique across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='Region ID. Allowed values:

- cn-hangzhou: East China 1 (Hangzhou).

- ap-southeast-1: Singapore.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='Service instance ID.

This parameter is required.', example='si-b58c874912fc4294****'),
}

model DeployServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D****'),
}

model DeployServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeployServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Deploy service instance in Created status.
 *
 * @param request DeployServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeployServiceInstanceResponse
 */
async function deployServiceInstanceWithOptions(request: DeployServiceInstanceRequest, runtime: $RuntimeOptions): DeployServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeployServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deploy service instance in Created status.
 *
 * @param request DeployServiceInstanceRequest
 * @return DeployServiceInstanceResponse
 */
async function deployServiceInstance(request: DeployServiceInstanceRequest): DeployServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return deployServiceInstanceWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      regionEndpoint?: string(name='RegionEndpoint', description='The region endpoint.', example='computenest.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='Regions', description='The available regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary List available regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: $RuntimeOptions): DescribeRegionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary List available regions.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model GenerateServicePolicyRequest {
  operationTypes?: [ string ](name='OperationTypes', description='The type of operation N for which you want to generate the policy information.

Valid values:

*   CreateServiceInstance: creates a serviceInstance by calling the CreateServiceInstance operation.
*   UpdateServiceInstance: updates a serviceInstance by calling the UpdateServiceInstance operation.
*   DeleteServiceInstance: deletes a serviceInstance by calling the DeleteServiceInstance operation.

>  The default value is the combination of all valid values.'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-b3e9ed878b0c4xxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='draft'),
  templateName?: string(name='TemplateName', description='The name of the template.', example='GPU-单机版'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='NotTrial'),
}

model GenerateServicePolicyResponseBody = {
  missingPolicy?: [ 
    {
      action?: [ string ](name='Action', description='Operations on specific resources.'),
      resource?: string(name='Resource', description='The specific objects authorized. An asterisk (*) denotes all resources.', example='*'),
      serviceName?: string(name='ServiceName', description='The name of the service.', example='ecs'),
    }
  ](name='MissingPolicy', description='The policies that are missing.'),
  policy?: string(name='Policy', description='The RAM policy.', example='{Statement": [{ "Action": ["oos:*"], "Effect": "Allow", "Resource": "*"},{ "Action": ["ecs:DescribeInstances"], "Effect": "Allow", "Resource": "*"},{ "Action": ["ecs:RunInstance"], "Effect": "Allow", "Resource": "*"}], "Version": "1"}'),
  requestId?: string(name='RequestId', description='The request ID.', example='5040BE9E-8DA2-5C9D-9B70-0EE6027A14BC'),
}

model GenerateServicePolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateServicePolicyResponseBody(name='body'),
}

/**
 * @summary 生成并校验服务创建stack所需要的权限
 *
 * @param request GenerateServicePolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateServicePolicyResponse
 */
async function generateServicePolicyWithOptions(request: GenerateServicePolicyRequest, runtime: $RuntimeOptions): GenerateServicePolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.operationTypes)) {
    query['OperationTypes'] = request.operationTypes;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateServicePolicy',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 生成并校验服务创建stack所需要的权限
 *
 * @param request GenerateServicePolicyRequest
 * @return GenerateServicePolicyResponse
 */
async function generateServicePolicy(request: GenerateServicePolicyRequest): GenerateServicePolicyResponse {
  var runtime = new $RuntimeOptions{};
  return generateServicePolicyWithOptions(request, runtime);
}

model GetServiceRequest {
  regionId?: string(name='RegionId', description='Region Id.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.', example='service-0e6fca6a51a544xxxxxx'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance id.', example='si-b58c874912fc4294****'),
  serviceName?: string(name='ServiceName', description='The service name.', example='Wordpress'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1.0'),
  showDetails?: [ string ](name='ShowDetails', description='Whether to disclose service details.'),
}

model GetServiceResponseBody = {
  alarmMetadata?: string(name='AlarmMetadata', description='The alert configurations of the service.

>  This parameter takes effect only when you specify an alert policy for **PolicyNames**.', example='{ "TemplateUrl": "http://template.file.url", "ApplicationGroups": [ { "Name": "applicationGroup1", "TemplateUrl": "url1" }, { "Name": "applicationGroup2", "TemplateUrl": "url2" } ] }'),
  categories?: string(name='Categories', description='The categories of the Flow.', example='AI'),
  commodity?: {
    chargeType?: string(name='ChargeType', description='The billing method of the service. Valid values:

*   **PREPAY** (default): subscription.
*   **POSTPAY**: pay-as-you-go.', example='POSTPAY'),
    commodityCode?: string(name='CommodityCode', description='The commodity code of the service in Alibaba Cloud Marketplace.', example='cmjj00****'),
    cssMetadata?: {
      componentsMappings?: [ 
        {
          mappings?: map[string]string(name='Mappings', description='The mappings.'),
          templateName?: string(name='TemplateName', description='The template name.', example='Template one.'),
        }
      ](name='ComponentsMappings', description='The mapping information about the billing items.'),
    }(name='CssMetadata', description='The configuration metadata related to Lingxiao.'),
    deployPage?: string(name='DeployPage', description='The deploy page.', example='Order： Order page
Detail： Detail page'),
    marketplaceMetadata?: {
      specificationMappings?: [ 
        {
          specificationCode?: string(name='SpecificationCode', description='The specification code of the service in Alibaba Cloud Marketplace.', example='cmjj00****'),
          specificationName?: string(name='SpecificationName', description='The package name.', example='Package one.'),
          templateName?: string(name='TemplateName', description='The template name.', example='Template one.'),
        }
      ](name='SpecificationMappings', description='The mappings between the service specifications and the template or package.'),
    }(name='MarketplaceMetadata', description='The metadata of Alibaba Cloud Marketplace.'),
    orderTime?: map[string][ string ](name='OrderTime', description='The order time.'),
    saasBoostMetadata?: string(name='SaasBoostMetadata', description='The configuration metadata related to Saas Boost.', example='{
    "Enabled":false    "PublicAccessUrl":"https://example.com"
}'),
    specifications?: [ 
      {
        code?: string(name='Code', description='The commodity code.', example='cmjj00****'),
        name?: string(name='Name', description='The specification name.', example='specifications1'),
        times?: [ string ](name='Times', description='The subscription duration. Unit: week or year.'),
      }
    ](name='Specifications', description='The specification details of the service in Alibaba Cloud Marketplace.'),
    type?: string(name='Type', description='The service type. Valid values:

*   marketplace: Alibaba Cloud Marketplace.
*   Css: Lingxiao.', example='Marketplace'),
  }(name='Commodity', description='The information about the order placed in Alibaba Cloud Marketplace.'),
  deployFrom?: string(name='DeployFrom', description='Service deployment approach, Valid values：

- NoWhere
- Marketplace
- ComputeNest', example='Marketplace'),
  deployMetadata?: string(name='DeployMetadata', description='The storage configurations of the service. The format in which the deployment information of a service is stored varies based on the deployment type of the service. In this case, the deployment information is stored in the JSON string format.', example='{\\\\"TemplateUrl\\\\": \\\\"http://tidbRosFile\\\\"}'),
  deployType?: string(name='DeployType', description='The deployment type of the service. Valid values:

*   ros: The service is deployed by using Resource Orchestration Service (ROS).
*   terraform: The service is deployed by using Terraform.', example='ros'),
  duration?: long(name='Duration', description='The duration for which hosted O\\\\&M is implemented. Unit: seconds.', example='259200'),
  instanceRoleInfos?: [ 
    {
      policyDocument?: string(name='PolicyDocument', description='The content of the policy.', example='{\\\\n  \\\\"Version\\\\": \\\\"1\\\\",\\\\n  \\\\"Statement\\\\": [\\\\n    {\\\\n      \\\\"Effect\\\\": \\\\"Allow\\\\",\\\\n      \\\\"Action\\\\": \\\\"*\\\\",\\\\n      \\\\"Principal\\\\": \\\\"*\\\\",\\\\n      \\\\"Resource\\\\": \\\\"*\\\\"\\\\n    }\\\\n  ]\\\\n}'),
      principals?: [ string ](name='Principals', description='The information of the RAM entity.'),
      roleName?: string(name='RoleName', description='The ram role name.', example='ram-for-dts'),
      templateName?: string(name='TemplateName', description='The template name.', example='Template one.'),
    }
  ](name='InstanceRoleInfos', description='Information about the ram role created in the service template.'),
  isSupportOperated?: boolean(name='IsSupportOperated', description='Indicates whether the hosted O\\\\&M feature is enabled for the service. Default value: false. Valid values:

*   true
*   false

>  This parameter is returned if you set **ServiceType** to **private**.', example='false'),
  licenseMetadata?: string(name='LicenseMetadata', description='The license metadata.', example='{\\\\"PayType\\\\":\\\\"CustomFixTime\\\\",\\\\"DefaultLicenseDays\\\\":7,\\\\"CustomMetadata\\\\":[{\\\\"TemplateName\\\\":\\\\"ECS\\\\",\\\\"SpecificationName\\\\":\\\\"bandwith-0\\\\",\\\\"CustomData\\\\":\\\\"1\\\\"}]}'),
  logMetadata?: string(name='LogMetadata', description='The logging configurations.', example='{\\\\"Logstores\\\\":[]}'),
  operationMetadata?: string(name='OperationMetadata', description='The operation metadata.', example='{\\\\"PrometheusConfigMap\\\\":{\\\\"New_Vpc_Ack_And_Jumpserver\\\\":{}}}'),
  permission?: string(name='Permission', description='The permissions on the service. Valid values:

*   Deployable: Permissions to deploy the service.
*   Accessible: Permissions to access the service.', example='Deployable'),
  policyNames?: string(name='PolicyNames', description='The policy name. The name can be up to 128 characters in length. Separate multiple names with commas (,). Only hosted O\\\\&M policies are supported.', example='policyName1, policyName2'),
  publishTime?: string(name='PublishTime', description='The time when the service was published.', example='2021-05-21T00:00:00Z'),
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
  serviceDocumentInfos?: [ 
    {
      documentUrl?: string(name='DocumentUrl', description='The URL that is used to access the document.', example='https://help.aliyun.com/zh/compute-nest/use-cases/deploy-an-sd-painting-service-instance?spm=a2c4g.11186623.0.i2'),
      locale?: string(name='Locale', description='The language that you use for the query. Valid values: zh-CN and en-US.', example='zh-CN'),
      templateName?: string(name='TemplateName', description='The template name.', example='Template one.'),
    }
  ](name='ServiceDocumentInfos', description='Service document information.'),
  serviceId?: string(name='ServiceId', description='The service ID.', example='service-0e6fca6a51a544xxxxxx'),
  serviceInfos?: [ 
    {
      agreements?: [ 
        {
          name?: string(name='Name', description='The agreement name.', example='User agreement'),
          url?: string(name='Url', description='The agreement URL.', example='https://url'),
        }
      ](name='Agreements', description='The agreement information about the service.'),
      image?: string(name='Image', description='The URL of the service icon.', example='https://example.com/service-image/c1c4a559-cc60-4af1-b976-98f356602462.png'),
      locale?: string(name='Locale', description='The language of the service. Valid values:

*   zh-CN: Chinese
*   en-US: English', example='zh-CN'),
      name?: string(name='Name', description='The service name.', example='Service document information.'),
      shortDescription?: string(name='ShortDescription', description='The description of the service.', example='Docker Community Edition (CE) is a free version of the Docker project, aimed at developers, enthusiasts, and individuals and organizations who want to use container technology.'),
      softwares?: [ 
        {
          name?: string(name='Name', description='The name of the Software.', example='wordpress'),
          version?: string(name='Version', description='The version of the software.', example='6.0.1'),
        }
      ](name='Softwares', description='The list of the software in the service.'),
    }
  ](name='ServiceInfos', description='The information about the service.'),
  serviceProductUrl?: string(name='ServiceProductUrl', description='The URL of the service page.', example='http://example1.com'),
  serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

- private: The service is a private service and is deployed within the account of a customer.
- managed: The service is a fully managed service and is deployed within the account of a service provider.
- operation: The service is a hosted O&M service.', example='private'),
  shareType?: string(name='ShareType', description='The permission type of the deployment URL. Valid values:

*   Public: All users can go to the URL to create a service instance or a trial service instance.
*   Restricted: Only users in the whitelist can go to the URL to create a service instance or a trial service instance.
*   OnlyFormalRestricted: Only users in the whitelist can go to the URL to create a service instance.
*   OnlyTrailRestricted: Only users in the whitelist can go to the URL to create a trial service instance.
*   Hidden: Users not in the whitelist cannot see the service details page when they go to the URL and cannot request deployment permissions.', example='Public'),
  status?: string(name='Status', description='The deploy status of the service. Valid values:
- Draft
- Beta
- Submitted
- Approved
- Launching
- Online
- Offline
- Creating', example='Online'),
  supplierDesc?: string(name='SupplierDesc', description='The description of service provider.', example='Computing Nest Community service'),
  supplierLogo?: string(name='SupplierLogo', description='The Logo of service provider.', example='https://service-info-public.oss-cn-hangzhou.aliyuncs.com/xxx/service-image/xxx.png'),
  supplierName?: string(name='SupplierName', description='The name of the service provider.', example='Alibaba Cloud'),
  supplierUid?: long(name='SupplierUid', description='The Alibaba Cloud account ID of the service provider.', example='158927391332*****'),
  supplierUrl?: string(name='SupplierUrl', description='The URL of the service provider.', example='http://example.com'),
  supportContacts?: [ 
    {
      type?: string(name='Type'),
      value?: string(name='Value'),
    }
  ](name='SupportContacts'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tags', description='The tags.'),
  tenantType?: string(name='TenantType', description='The type of the tenant. Valid values:

*   SingleTenant
*   MultiTenant', example='SingleTenant'),
  trialDuration?: long(name='TrialDuration', description='The trial duration. Unit: day. The maximum trial duration cannot exceed 30 days.', example='7'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='Trial'),
  version?: string(name='Version', description='The service version.', example='1.0'),
  versionName?: string(name='VersionName', description='The version name.', example='v1'),
}

model GetServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceResponseBody(name='body'),
}

/**
 * @summary Queries the information about a service.
 *
 * @param request GetServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceResponse
 */
async function getServiceWithOptions(request: GetServiceRequest, runtime: $RuntimeOptions): GetServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.showDetails)) {
    query['ShowDetails'] = request.showDetails;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetService',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a service.
 *
 * @param request GetServiceRequest
 * @return GetServiceResponse
 */
async function getService(request: GetServiceRequest): GetServiceResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceWithOptions(request, runtime);
}

model GetServiceEstimateCostRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='qwertyuiop'),
  commodity?: {
    couponId?: string(name='CouponId', description='优惠券ID', example='302070970220'),
    payPeriod?: int32(name='PayPeriod', description='The subscription duration.', example='1'),
    payPeriodUnit?: string(name='PayPeriodUnit', description='The unit of the subscription duration. Valid values:

*   Year
*   Month
*   Day', example='Year'),
  }(name='Commodity', description='The information about the subscription duration.'),
  operationName?: string(name='OperationName', description='The name of the configuration change operation.', example='Parameter change'),
  parameters?: map[string]any(name='Parameters', description='The parameters that are specified to deploy the service instance.', example='{ \\\\"RegionId\\\\": \\\\"cn-hangzhou\\\\", \\\\"InstanceType\\\\": \\\\"ecs.g5.large\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-12xxxxxx'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-d6ab3a63ccbb4b17xxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  specificationName?: string(name='SpecificationName', description='The name of the package specification.', example='Package 1'),
  templateName?: string(name='TemplateName', description='The template name.', example='Template 1'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='NotTrial'),
}

model GetServiceEstimateCostShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='qwertyuiop'),
  commodityShrink?: string(name='Commodity', description='The information about the subscription duration.'),
  operationName?: string(name='OperationName', description='The name of the configuration change operation.', example='Parameter change'),
  parametersShrink?: string(name='Parameters', description='The parameters that are specified to deploy the service instance.', example='{ \\\\"RegionId\\\\": \\\\"cn-hangzhou\\\\", \\\\"InstanceType\\\\": \\\\"ecs.g5.large\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-12xxxxxx'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-d6ab3a63ccbb4b17xxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  specificationName?: string(name='SpecificationName', description='The name of the package specification.', example='Package 1'),
  templateName?: string(name='TemplateName', description='The template name.', example='Template 1'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='NotTrial'),
}

model GetServiceEstimateCostResponseBody = {
  commodity?: map[string]CommodityValue(name='Commodity', description='The estimated price.', example='{\\\\"cmgj00059839\\\\": {\\\\"Result\\\\": {\\\\"InquiryType\\\\": \\\\"Buy\\\\", \\\\"Order\\\\": {\\\\"Currency\\\\": \\\\"CNY\\\\", \\\\"DiscountAmount\\\\": \\\\"0.0\\\\", \\\\"TradeAmount\\\\": \\\\"0.01\\\\", \\\\"OriginalAmount\\\\": \\\\"0.01\\\\"}}}}'),
  requestId?: string(name='RequestId', description='The request ID.', example='08ABBB67-39C9-5EE7-98E5-80486F75CE8D'),
  resources?: map[string]any(name='Resources', description='The resources.', example='{ "EcsInstance" : { "Type" : "ALIYUN::ECS::Instance", "Success" : true, "Result" : { "Order" : { "Currency" : "CNY", "RuleIds" : [ "102111101338\\\\*\\\\*\\\\*\\\\*" ], "DetailInfos" : { "ResourcePriceModel" : [ { "OriginalPrice" : 0, "DiscountPrice" : 0, "SubRules" : { "Rule" : [ ] }, "Resource" : "bandwidth", "TradePrice" : 0 }, { "OriginalPrice" : 0, "DiscountPrice" : 0, "SubRules" : { "Rule" : [ ] }, "Resource" : "image", "TradePrice" : 0 }, { "OriginalPrice" : 0.366666, "DiscountPrice" : 0.249012, "SubRules" : { "Rule" : [ ] }, "Resource" : "instanceType", "TradePrice" : 0.117654 }, { "OriginalPrice" : 0.055555, "DiscountPrice" : 0.037729, "SubRules" : { "Rule" : [ ] }, "Resource" : "systemDisk", "TradePrice" : 0.017826 } ] }, "TradeAmount" : 0.135, "OriginalAmount" : 0.422, "Coupons" : { "Coupon" : [ ] }, "DiscountAmount" : 0.287 }, "OrderSupplement" : { "PriceUnit" : "/Hour", "ChargeType" : "PostPaid", "Quantity" : 1, "PriceType" : "Total" }, "Rules" : { "Rule" : [ { "RuleDescId" : "102111101338\\\\*\\\\*\\\\*\\\\*", "Name" : "contract discount_multi-billing item discount_3.208750 discount" } ] } } } }'),
}

model GetServiceEstimateCostResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceEstimateCostResponseBody(name='body'),
}

/**
 * @summary Queries the estimated price for creating a service instance.
 *
 * @param tmpReq GetServiceEstimateCostRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceEstimateCostResponse
 */
async function getServiceEstimateCostWithOptions(tmpReq: GetServiceEstimateCostRequest, runtime: $RuntimeOptions): GetServiceEstimateCostResponse {
  tmpReq.validate();
  var request = new GetServiceEstimateCostShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.commodity)) {
    request.commodityShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.commodity, 'Commodity', 'json');
  }
  if (!$isNull(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.commodityShrink)) {
    query['Commodity'] = request.commodityShrink;
  }
  if (!$isNull(request.operationName)) {
    query['OperationName'] = request.operationName;
  }
  if (!$isNull(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.specificationName)) {
    query['SpecificationName'] = request.specificationName;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetServiceEstimateCost',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the estimated price for creating a service instance.
 *
 * @param request GetServiceEstimateCostRequest
 * @return GetServiceEstimateCostResponse
 */
async function getServiceEstimateCost(request: GetServiceEstimateCostRequest): GetServiceEstimateCostResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceEstimateCostWithOptions(request, runtime);
}

model GetServiceInstanceRequest {
  marketInstanceId?: string(name='MarketInstanceId', description='The MarketInstance ID.', example='704***59'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.

>  You must specify either `ServiceInstanceId` or `MarketInstanceId`. Otherwise, the operation fails.', example='si-d6ab3a63ccbb4b17****'),
}

model GetServiceInstanceResponseBody = {
  bizStatus?: string(name='BizStatus', description='The business state of the service instance. Valid values:

*   Normal
*   Renewing
*   RenewFailed
*   Expired', example='Normal'),
  components?: string(name='Components', description='Cloud Marketplace additional billing items.', example='{"TiKVServerCount":"3","package_version":"yuncode5398300001","PDServerCount":"3","TiDBServerCount":"2"}'),
  createTime?: string(name='CreateTime', description='The time when the serviceInstance was created.', example='2021-05-20T00:00:00Z'),
  enableInstanceOps?: boolean(name='EnableInstanceOps', description='Indicates whether the service instance supports the operation feature. Valid values:

*   true
*   false', example='true'),
  enableUserPrometheus?: boolean(name='EnableUserPrometheus', description='Whether to enable Prometheus monitoring.', example='true'),
  endTime?: string(name='EndTime', description='The expiration time of service instance.', example='2022-01-01T12:00:00'),
  grafanaDashBoardUrl?: string(name='GrafanaDashBoardUrl', description='The URL of the Grafana dashboard.', example='https://g.console.aliyun.com/d/xxxxxxxx-cn-mariadb/mysql-xxxxxx-xxxxxxxx-and-dashboard?orgId=355401&refresh=10s'),
  isOperated?: boolean(name='IsOperated', description='Indicates whether the hosted O\\\\&M feature is enabled for the service instance. Valid values:

*   true
*   false', example='true'),
  licenseEndTime?: string(name='LicenseEndTime', description='The expiration time of licence.', example='2022-01-01T12:00:00'),
  marketInstanceId?: string(name='MarketInstanceId', description='The market Instance ID.', example='704***59'),
  name?: string(name='Name', description='The name of the service instance.', example='TestName'),
  networkConfig?: {
    endpointId?: string(name='EndpointId', description='The ID of the endpoint for the private connection.

>  This parameter is discontinued.', example='ep-m5ei37240541816b****'),
    privateVpcConnections?: [ 
      {
        connectionConfigs?: [ 
          {
            connectBandwidth?: int32(name='ConnectBandwidth', description='The bandwidth limit for the private connection established based on the private network interconnection mode of Compute Nest.', example='1536Mbps'),
            domainName?: string(name='DomainName', description='The domain name.', example='ie-569a9be34f5534f6bc6559b5c1xxxxxx.service-51f80502802e48xxxxxx.cn-hangzhou.computenest.aliyuncs.com'),
            endpointIps?: [ string ](name='EndpointIps', description='The IP addresses of the endpoints of the private connections.'),
            ingressEndpointStatus?: string(name='IngressEndpointStatus', description='The state of the ingress endpoint. Valid values:

*   Ready: The ingress endpoint is connected.
*   Pending: The ingress endpoint is being connected.
*   Failed: The ingress endpoint fails to be connected.
*   Deleted: The ingress endpoint is deleted.
*   Deleting: The ingress endpoint is being deleted.', example='Ready'),
            networkServiceStatus?: string(name='NetworkServiceStatus', description='The state of the network service. Valid values:

*   Ready: The network service is connected.
*   Pending: The network service is being connected.
*   Failed: The network service fails to be connected.
*   Deleted: The network service is deleted.
*   Deleting: The network service is being deleted.', example='Ready'),
            regionId?: string(name='RegionId', description='The region ID of the VPC to which the endpoint of the private connection established based on the private network interconnection mode of Compute Nest belongs.', example='cn-beijing'),
            securityGroups?: [ string ](name='SecurityGroups', description='The names of the security groups.'),
            vSwitches?: [ string ](name='VSwitches', description='The names of the vSwitches.'),
            vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-bp1vwnn14rqpyiczj****'),
          }
        ](name='ConnectionConfigs', description='The network configurations, which are mainly used for private connections.'),
        endpointId?: string(name='EndpointId', description='The endpoint ID of the private connection.', example='ep-m5ei37240541816b****'),
        privateZoneId?: string(name='PrivateZoneId', description='The ID of the private zone of the custom private domain name.', example='cb7f214f80ac348d87daaeac1f35****'),
        privateZoneName?: string(name='PrivateZoneName', description='The custom domain name.', example='test.computenest.aliyuncs.com'),
        regionId?: string(name='RegionId', description='The region ID of the endpoint of the PrivateLink connection.', example='cn-hangzhou'),
      }
    ](name='PrivateVpcConnections', description='The information about private connections.'),
    privateZoneId?: string(name='PrivateZoneId', description='The PrivateZone ID.', example='cb7f214f80ac348d87daaeac1f35****'),
    reversePrivateVpcConnections?: [ 
      {
        endpointId?: string(name='EndpointId', description='The endpoint ID of the reverse private connection.', example='ep-m5ei42370541816b****'),
      }
    ](name='ReversePrivateVpcConnections', description='The information about the reverse private connection.'),
  }(name='NetworkConfig', description='The network configurations.

>  This parameter is discontinued.'),
  operatedServiceInstanceId?: string(name='OperatedServiceInstanceId', description='The serviceInstance  to be operated.', example='si-d6ab3a63ccbb4b17****'),
  operationEndTime?: string(name='OperationEndTime', description='The operation end time.', example='2022-01-28T06:48:56Z'),
  operationStartTime?: string(name='OperationStartTime', description='The operation start time.', example='2021-12-29T06:48:56Z'),
  outputs?: string(name='Outputs', description='The outputs returned from creating the service instance.

*   If the service is deployed by using a ROS template, all output fields of the template are returned.
*   If the service is deployed by calling an SPI operation, the output fields of the service provider and for the Compute Nest additional features are returned.', example='{"InstanceIds":["i-hp38ofxl0dsyfi7z****"]}'),
  parameters?: string(name='Parameters', description='The parameters configured for the service instance.', example='{"param":"value"}'),
  payType?: string(name='PayType', description='The billing method of the instance for market. Valid values:

*   Permanent: Permanent purchase
*   Subscription: Subscription.
*   PayAsYouGo: Pay-as-you-go.
*   CustomFixTime: Merchant custom fixed duration.', example='Subscription'),
  predefinedParameterName?: string(name='PredefinedParameterName', description='The package name.', example='Package one'),
  progress?: long(name='Progress', description='The deployment progress of the service instance. Unit: percentage.', example='90'),
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-bp67acfmxazb4p****'),
  resources?: string(name='Resources', description='The resources.', example='[{"StackId": "stack-xxx"}]'),
  service?: {
    deployMetadata?: string(name='DeployMetadata', description='The storage configurations of the service. The format in which the deployment information of a service is stored varies based on the deployment type of the service. In this case, the deployment information is stored in the JSON string format.'),
    deployType?: string(name='DeployType', description='The deployment type of the service. Valid values:

*   ros: The service is deployed by using Resource Orchestration Service (ROS).
*   terraform: The service is deployed by using Terraform.
*   ack: The service is deployed by using Container Service for Kubernetes (ACK).
*   spi: The service is deployed by calling a service provider interface (SPI).
*   operation: The service is deployed by using a hosted O\\\\&M service.', example='ros'),
    publishTime?: string(name='PublishTime', description='The time when the service version was published.', example='2021-05-21T00:00:00Z'),
    serviceDocUrl?: string(name='ServiceDocUrl', description='The URL of the service documentation.', example='http://example.com'),
    serviceId?: string(name='ServiceId', description='The service ID.', example='service-9c8a3522528b4fe8****'),
    serviceInfos?: [ 
      {
        image?: string(name='Image', description='The URL of the service icon.', example='https://example.com/service-image/c1c4a559-cc60-4af1-b976-98f356602462.png'),
        locale?: string(name='Locale', description='The language of the service instance.', example='zh-CN'),
        name?: string(name='Name', description='The name of the service.', example='Docker Community Edition'),
        shortDescription?: string(name='ShortDescription', description='The description of the service.', example='Docker Community Edition (CE) is a free version of the Docker project, aimed at developers, enthusiasts, and individuals and organizations who want to use container technology.'),
      }
    ](name='ServiceInfos', description='The information about the service.'),
    serviceProductUrl?: string(name='ServiceProductUrl', description='The URL of the service page.', example='https://service-info-private.oss-cn-hangzhou.aliyuncs.com'),
    serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

*   private: The service is a private service and is deployed within the account of a customer.
*   managed: The service is a fully managed service and is deployed within the account of a service provider.
*   operation: The service is a hosted O\\\\&M service.', example='private'),
    status?: string(name='Status', description='The status of the service. Valid values:

*   Draft
*   Submited
*   Approved
*   Online
*   Offline
*   Deleted
*   Launching
*   Beta', example='Online'),
    supplierName?: string(name='SupplierName', description='The name of the service provider.', example='Alibaba Cloud'),
    supplierUrl?: string(name='SupplierUrl', description='The URL of the service provider.', example='http://example.com'),
    upgradableServiceInfos?: [ 
      {
        version?: string(name='Version', description='An upgradable service version.', example='draft'),
        versionName?: string(name='VersionName', description='The version name of an upgradable service version.', example='0.1.0'),
      }
    ](name='UpgradableServiceInfos', description='The upgradable service version.'),
    upgradableServiceVersions?: [ string ](name='UpgradableServiceVersions', description='The service version that can be updated.'),
    upgradeMetadata?: string(name='UpgradeMetadata', description='The metadata about the upgrade.', example='{
  "Type": "OOS",
  "Description": "Changelog or something description",
  "SupportUpgradeFromVersions": [1, 2],
  "UpgradeSteps": {
    "PreUpgradeStage": {
      "Description": "初始化数据库",
      "Type": "RunCommand",
      "ResourceName": "EcsRole1",
      "CommandType": "runShellScript",
      "CommandContent": "echo hello"
    },
    "UpgradeStage": [{
      "Description": "更新EcsRole1实例",
      "Type": "RunCommand",
      "ResourceName": "EcsRole1",
      "ArtifactsDownloadDirectory": "/home/admin",
      "CommandType": "runShellScript",
      "CommandContent": "echo hello"
    }],
    "PostUpgradeStage": {
      "Description": "部署后post check",
      "Type": "None/RunCommand",
      "ResourceName": "EcsRole1",
      "CommandType": "runShellScript",
      "CommandContent": "echo hello"
    }
  }
}'),
    version?: string(name='Version', description='The service version.', example='1'),
    versionName?: string(name='VersionName', description='The custom version name defined by the service provider.', example='1.1.0'),
  }(name='Service', description='The information about the service to which the service instance belongs.'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4b17****'),
  serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

- private: The service is a private service and is deployed within the account of a customer.
- managed: The service is a fully managed service and is deployed within the account of a service provider.
- operation: The service is a hosted O&M service.', example='private'),
  source?: string(name='Source', description='The source of the serviceInstance. Valid values:
- User
- Market
- Supplier', example='User'),
  status?: string(name='Status', description='The deploy status of the serviceInstance. Valid values:
- Created
- Deploying
- DeployedFailed
- Deployed
- Upgrading
- Deleting
- Deleted
- DeletedFailed', example='Deployed'),
  statusDetail?: string(name='StatusDetail', description='The description of the deployment state of the service instance.', example='deploy successfully'),
  supplierUid?: long(name='SupplierUid', description='The Alibaba Cloud account ID of the service provider.', example='158927391332*****'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tags', description='The tags.'),
  templateName?: string(name='TemplateName', description='The template name.', example='Template one'),
  updateTime?: string(name='UpdateTime', description='The time when the serviceInstance  was last updated.', example='2021-05-20T00:00:00Z'),
  userId?: long(name='UserId', description='The AliUid of the user.', example='130920852836****'),
}

model GetServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Queries the information about a service instance based on the region ID and the ID of the service instance or the Alibaba Cloud Marketplace instance. Information including the service status, template name, and involved resources are returned.
 *
 * @param request GetServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceInstanceResponse
 */
async function getServiceInstanceWithOptions(request: GetServiceInstanceRequest, runtime: $RuntimeOptions): GetServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.marketInstanceId)) {
    query['MarketInstanceId'] = request.marketInstanceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a service instance based on the region ID and the ID of the service instance or the Alibaba Cloud Marketplace instance. Information including the service status, template name, and involved resources are returned.
 *
 * @param request GetServiceInstanceRequest
 * @return GetServiceInstanceResponse
 */
async function getServiceInstance(request: GetServiceInstanceRequest): GetServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceInstanceWithOptions(request, runtime);
}

model GetServiceInstanceSubscriptionEstimateCostRequest {
  clientToken?: string(name='ClientToken', description='Ensures idempotence of the request. Generate a parameter value from your client to ensure its uniqueness across different requests. **ClientToken** supports only ASCII characters and cannot exceed 64 characters.', example='123e4567-e89b-12d3-a456-426655440000'),
  orderType?: string(name='OrderType', description='Order type. Possible value: Renewal.

This parameter is required.', example='Renewal'),
  period?: int32(name='Period', description='The renewal duration for all prepaid resources of the service instance. The unit is specified by PeriodUnit.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The time unit for the renewal duration of all prepaid resources of the service instance, which is the unit of the Period parameter. Valid values: Month, Year. Default value: Month.', example='Month'),
  regionId?: string(name='RegionId', description='Region ID.', example='cn-hangzhou'),
  resourcePeriod?: [ 
    {
      period?: int32(name='Period', description='Renewal duration. The unit is specified by PeriodUnit.', example='1'),
      periodUnit?: string(name='PeriodUnit', description='The time unit for the resource renewal duration, which is the unit of the Period parameter. Valid values: Month, Year. Default value: Month.', example='Month'),
      resourceArn?: string(name='ResourceArn', description='Resource ARN (Aliyun Resource Name).', example='acs:ecs:cn-guangzhou:1361753504587228:instance/i-7xv9pgeqvhxg10jji3vd'),
    }
  ](name='ResourcePeriod', description='Resource renewal configuration.'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='Service instance ID.

This parameter is required.', example='si-d6ab3a63ccbb4b17****'),
}

model GetServiceInstanceSubscriptionEstimateCostResponseBody = {
  requestId?: string(name='RequestId', description='Request ID.', example='464C8CB6-A548-5206-B83C-D32A8E43EC21'),
  resourcePrices?: [ 
    {
      currency?: string(name='Currency', description='Currency. Valid values:
- CNY: Chinese Yuan.
- USD: US Dollar.
- JPY: Japanese Yen.', example='CNY'),
      detailInfos?: [ 
        {
          discountAmount?: float(name='DiscountAmount', description='Discount amount.', example='100'),
          originalAmount?: float(name='OriginalAmount', description='Original price.', example='900'),
          resource?: string(name='Resource', description='Pricing module identifier.', example='instance'),
          tradeAmount?: float(name='TradeAmount', description='Discounted price.', example='500'),
        }
      ](name='DetailInfos', description='The price details of the pricing module.'),
      discountAmount?: float(name='DiscountAmount', description='Discount.', example='100'),
      originalAmount?: float(name='OriginalAmount', description='Original price.', example='900'),
      period?: int32(name='Period', description='Renewal duration. The unit is specified by PeriodUnit.', example='1'),
      periodUnit?: string(name='PeriodUnit', description='The time unit for the renewal duration, which is the unit of the Period parameter. Valid values: Month, Year. Default value: Month.', example='Month'),
      resourceArn?: string(name='ResourceArn', description='Resource ARN (Aliyun Resource Name).', example='acs:ecs:cn-hongkong:1488317743351199:instance/i-j6c6f3lbky38o8rpeqw2'),
      rules?: [ 
        {
          description?: string(name='Description', description='Promotion description.', example='test'),
          name?: string(name='Name', description='Promotion name.', example='test'),
          ruleDescId?: long(name='RuleDescId', description='Promotion ID.', example='1021199213'),
        }
      ](name='Rules', description='Promotion details.'),
      tradeAmount?: float(name='TradeAmount', description='Discounted price.', example='500'),
    }
  ](name='ResourcePrices', description='List of resource price information.'),
}

model GetServiceInstanceSubscriptionEstimateCostResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceInstanceSubscriptionEstimateCostResponseBody(name='body'),
}

/**
 * @summary Query renewal prices for prepaid resources of private deployment service instance. You can query renewal prices for all prepaid resources included in a service instance, or query renewal prices for specified resources. Only one of the two methods can be used.
 *
 * @param request GetServiceInstanceSubscriptionEstimateCostRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceInstanceSubscriptionEstimateCostResponse
 */
async function getServiceInstanceSubscriptionEstimateCostWithOptions(request: GetServiceInstanceSubscriptionEstimateCostRequest, runtime: $RuntimeOptions): GetServiceInstanceSubscriptionEstimateCostResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourcePeriod)) {
    query['ResourcePeriod'] = request.resourcePeriod;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetServiceInstanceSubscriptionEstimateCost',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query renewal prices for prepaid resources of private deployment service instance. You can query renewal prices for all prepaid resources included in a service instance, or query renewal prices for specified resources. Only one of the two methods can be used.
 *
 * @param request GetServiceInstanceSubscriptionEstimateCostRequest
 * @return GetServiceInstanceSubscriptionEstimateCostResponse
 */
async function getServiceInstanceSubscriptionEstimateCost(request: GetServiceInstanceSubscriptionEstimateCostRequest): GetServiceInstanceSubscriptionEstimateCostResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceInstanceSubscriptionEstimateCostWithOptions(request, runtime);
}

model GetServiceProvisionsRequest {
  parameters?: map[string]any(name='Parameters', description='The parameters configured for the service instance.', example='{\\\\"RegionId\\\\":\\\\"cn-hangzhou\\\\",\\\\"ZoneId\\\\":\\\\"cn-hangzhou-g\\\\",\\\\"EcsInstanceType\\\\":\\\\"ecs.g5.large\\\\",\\\\"InstancePassword\\\\":\\\\"xxxxxxxx\\\\",\\\\"PayType\\\\":\\\\"PostPaid\\\\",\\\\"PayPeriodUnit\\\\":\\\\"Month\\\\",\\\\"PayPeriod\\\\":1}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-0efc0db451794bxxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The version of the service.', example='1'),
  templateName?: string(name='TemplateName', description='The template name.', example='ECS'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='Trial'),
}

model GetServiceProvisionsShrinkRequest {
  parametersShrink?: string(name='Parameters', description='The parameters configured for the service instance.', example='{\\\\"RegionId\\\\":\\\\"cn-hangzhou\\\\",\\\\"ZoneId\\\\":\\\\"cn-hangzhou-g\\\\",\\\\"EcsInstanceType\\\\":\\\\"ecs.g5.large\\\\",\\\\"InstancePassword\\\\":\\\\"xxxxxxxx\\\\",\\\\"PayType\\\\":\\\\"PostPaid\\\\",\\\\"PayPeriodUnit\\\\":\\\\"Month\\\\",\\\\"PayPeriod\\\\":1}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-0efc0db451794bxxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The version of the service.', example='1'),
  templateName?: string(name='TemplateName', description='The template name.', example='ECS'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='Trial'),
}

model GetServiceProvisionsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='8C27145F-C9F4-545D-A355-DCDDAD63D548'),
  serviceProvisions?: [ 
    {
      autoEnableService?: boolean(name='AutoEnableService', description='Indicates whether automatic activation for the service is defined in the template. Valid values:

*   true: Automatic activation for the service is defined in the template.
*   false: Manual activation for the service is defined in the template.', example='true'),
      enableURL?: string(name='EnableURL', description='The URL that points to the activation page of the service.

> This parameter is returned if Status is set to Disabled.', example='https://common-buy.aliyun.com/?commodityCode=sls'),
      roleProvision?: {
        authorizationURL?: string(name='AuthorizationURL', description='The authorization URL of the RAM role.

> This parameter is returned if Created is set to false.', example='https://ram.console.aliyun.com/role/authorization?request={"Services":[{"Service":"CS","Roles":[{"RoleName":"AliyunCSManagedVKRole","TemplateId":"AliyunCSManagedVKRole"},{"RoleName":"AliyunCSDefaultRole","TemplateId":"Default"}]}],"ReturnUrl":"https://cs.console.aliyun.com/"}'),
        roles?: [ 
          {
            apiForCreation?: {
              apiName?: string(name='ApiName', description='The name of the API operation.', example='CreateServiceLinkedRole'),
              apiProductId?: string(name='ApiProductId', description='The ID of the Alibaba Cloud service to which the API operation belongs.', example='rds'),
              apiType?: string(name='ApiType', description='The type of the API operation. Valid values:

*   Open: public
*   Inner: private', example='Open'),
              parameters?: map[string]any(name='parameters', description='The ROS parameters of the cluster.', example='{ "ServiceLinkedRole": "AliyunServiceRoleForRdsPgsqlOnEcs", "RegionId": "${RegionId}" }'),
            }(name='ApiForCreation', description='The information about the API operation that is used to create the RAM role.'),
            created?: boolean(name='Created', description='Indicates whether the RAM role is created. Valid values:

*   true
*   false', example='true'),
            function?: string(name='Function', description='The purpose for which the RAM role is used. Default value: Default. A value of Default indicates that the RAM role is the default role of the service.', example='Default'),
            roleName?: string(name='RoleName', description='The name of the role.', example='AliyunCSManagedVKRole'),
          }
        ](name='Roles', description='The RAM roles of the service.'),
      }(name='RoleProvision', description='The information about the RAM roles of the service. If this parameter is empty, no RAM role is associated with the service.'),
      serviceName?: string(name='ServiceName', description='The service name.', example='CS'),
      status?: string(name='Status', description='The activation status of the service. Valid values:

*   Enabled: The service is activated.
*   Disabled: The service is not activated.
*   Unknown: The activation status of the service is unknown.', example='Enabled'),
      statusReason?: string(name='StatusReason', description='The reason why the service is in the Disabled or Unknown state.

> This parameter is returned if Status is set to Disabled or Unknown.', example='No permission'),
    }
  ](name='ServiceProvisions', description='The information about the services.'),
}

model GetServiceProvisionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceProvisionsResponseBody(name='body'),
}

/**
 * @summary 计算巢查询服务是否开通
 *
 * @param tmpReq GetServiceProvisionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceProvisionsResponse
 */
async function getServiceProvisionsWithOptions(tmpReq: GetServiceProvisionsRequest, runtime: $RuntimeOptions): GetServiceProvisionsResponse {
  tmpReq.validate();
  var request = new GetServiceProvisionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!$isNull(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetServiceProvisions',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 计算巢查询服务是否开通
 *
 * @param request GetServiceProvisionsRequest
 * @return GetServiceProvisionsResponse
 */
async function getServiceProvisions(request: GetServiceProvisionsRequest): GetServiceProvisionsResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceProvisionsWithOptions(request, runtime);
}

model GetServiceTemplateParameterConstraintsRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  deployRegionId?: string(name='DeployRegionId', description='The region ID of the service instance.

This parameter is required.', example='cn-hangzhou'),
  enablePrivateVpcConnection?: boolean(name='EnablePrivateVpcConnection', description='Specifies whether to enable the private connection. Valid values:

*   true
*   false', example='true'),
  parameters?: [ 
    {
      parameterKey?: string(name='ParameterKey', description='The name of the parameter. If you do not specify Parameters, the parameters and values in the template are used.

>  Parameters is an optional parameter. ParameterKey is required if you specify Parameters.', example='InstanceType'),
      parameterValue?: string(name='ParameterValue', description='The parameter value that is defined in the template.

>  Parameters is an optional parameter. ParameterValue is required if you specify Parameters.', example='cn-hangzhou-j'),
    }
  ](name='Parameters', description='The configuration parameters of the service instance.'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-731f788406024axxxxxx'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-461ee95f46ca46xxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The service version.', example='1'),
  specificationName?: string(name='SpecificationName', description='The name of the specification package.', example='套餐一'),
  templateName?: string(name='TemplateName', description='The template name.

This parameter is required.', example='模板1'),
  trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='NotTrial'),
}

model GetServiceTemplateParameterConstraintsResponseBody = {
  familyConstraints?: [ string ](name='FamilyConstraints', description='The package family constraints.'),
  parameterConstraints?: [ 
    {
      allowedValues?: [ string ](name='AllowedValues', description='The valid values of the parameter.'),
      associationParameterNames?: [ string ](name='AssociationParameterNames', description='The names of the associated parameters.'),
      behavior?: string(name='Behavior', description='The behavior of the parameter. Valid values:

*   NoLimit: No limit is imposed on the value of this parameter.
*   NotSupport: The value of this parameter cannot be queried.
*   QueryError: This parameter failed to be queried.

>  If AllowedValues is not returned, Behavior and BehaviorReason are returned, which indicate the behavior of the parameter and the reason for the behavior.', example='NoLimit'),
      behaviorReason?: string(name='BehaviorReason', description='The reason why the behavior of the parameter is returned.', example='No resource property refer to the parameter'),
      originalConstraints?: [ 
        {
          allowedValues?: [ string ](name='AllowedValues', description='The valid values of the parameter.'),
          propertyName?: string(name='PropertyName', description='The property name.', example='ZoneId'),
          resourceName?: string(name='ResourceName', description='The name of the resource that is defined in the template.', example='MyECS'),
          resourceType?: string(name='ResourceType', description='The resource type.', example='ALIYUN::ECS::InstanceGroup'),
        }
      ](name='OriginalConstraints', description='The original constraint information.'),
      parameterKey?: string(name='ParameterKey', description='The name of the parameter.', example='ZoneInfo'),
      queryErrors?: [ 
        {
          errorMessage?: string(name='ErrorMessage', description='The error message.', example='record not exist'),
          resourceName?: string(name='ResourceName', description='The resource name.', example='MyECS'),
          resourceType?: string(name='ResourceType', description='The resource type.', example='ALIYUN::ECS::InstanceGroup'),
        }
      ](name='QueryErrors', description='The error details that are returned if the request fails.'),
      type?: string(name='Type', description='The data type of the parameter.', example='String'),
    }
  ](name='ParameterConstraints', description='The constraints on the parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='449DC03D-A039-56A6-8D6F-6EBCCCE0EE2C'),
}

model GetServiceTemplateParameterConstraintsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceTemplateParameterConstraintsResponseBody(name='body'),
}

/**
 * @summary Queries the constraints on the parameters in an Resource Orchestration Service (ROS) template.
 *
 * @param request GetServiceTemplateParameterConstraintsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceTemplateParameterConstraintsResponse
 */
async function getServiceTemplateParameterConstraintsWithOptions(request: GetServiceTemplateParameterConstraintsRequest, runtime: $RuntimeOptions): GetServiceTemplateParameterConstraintsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.deployRegionId)) {
    query['DeployRegionId'] = request.deployRegionId;
  }
  if (!$isNull(request.enablePrivateVpcConnection)) {
    query['EnablePrivateVpcConnection'] = request.enablePrivateVpcConnection;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  if (!$isNull(request.specificationName)) {
    query['SpecificationName'] = request.specificationName;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.trialType)) {
    query['TrialType'] = request.trialType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetServiceTemplateParameterConstraints',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the constraints on the parameters in an Resource Orchestration Service (ROS) template.
 *
 * @param request GetServiceTemplateParameterConstraintsRequest
 * @return GetServiceTemplateParameterConstraintsResponse
 */
async function getServiceTemplateParameterConstraints(request: GetServiceTemplateParameterConstraintsRequest): GetServiceTemplateParameterConstraintsResponse {
  var runtime = new $RuntimeOptions{};
  return getServiceTemplateParameterConstraintsWithOptions(request, runtime);
}

model GetUserInformationRequest {
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model GetUserInformationResponseBody = {
  deliverySettings?: {
    actiontrailDeliveryToOssEnabled?: boolean(name='ActiontrailDeliveryToOssEnabled', description='Indicates whether screencast delivery to OSS is enabled. Valid values:

*   true
*   false', example='true'),
    ossBucketName?: string(name='OssBucketName', description='The name of the OSS bucket.', example='0101data'),
    ossEnabled?: boolean(name='OssEnabled', description='Indicates whether screencast delivery to Object Storage Service (OSS) is enabled. Valid values:

*   true
*   false', example='true'),
    ossExpirationDays?: long(name='OssExpirationDays', description='The number of days for which the screencasts are saved.', example='7'),
    ossPath?: string(name='OssPath', description='The OSS path.', example='/test'),
  }(name='DeliverySettings', description='The delivery settings.'),
  requestId?: string(name='RequestId', description='The request ID.', example='52EBAF16-22F6-53DB-AE1E-44764FC62AF0'),
}

model GetUserInformationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserInformationResponseBody(name='body'),
}

/**
 * @summary Queries the information about a customer.
 *
 * @param request GetUserInformationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserInformationResponse
 */
async function getUserInformationWithOptions(request: GetUserInformationRequest, runtime: $RuntimeOptions): GetUserInformationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUserInformation',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a customer.
 *
 * @param request GetUserInformationRequest
 * @return GetUserInformationResponse
 */
async function getUserInformation(request: GetUserInformationRequest): GetUserInformationResponse {
  var runtime = new $RuntimeOptions{};
  return getUserInformationWithOptions(request, runtime);
}

model ListPoliciesRequest {
  maxResults?: int32(name='MaxResults', description='Page size.', example='20'),
  nextToken?: string(name='NextToken', description='Token for the next query, an empty nextToken indicates there is no next page.', example='BBBAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='Region ID.', example='cn-hangzhou'),
}

model ListPoliciesResponseBody = {
  maxResults?: int32(name='MaxResults', description='分页大小。', example='20'),
  nextToken?: string(name='NextToken', description='Next Token', example='AAAAAZ9FmxgN6wKfeK/GOKRnnjU='),
  policies?: [ 
    {
      description?: string(name='Description', description='Permission policy description.', example='Only read permission policy'),
      policyDocument?: string(name='PolicyDocument', description='Policy content.', example='{"Action":["*:Describe*","*:List*","*:Get*","*:BatchGet*","*:Query*","*:BatchQuery*","actiontrail:LookupEvents"],"Resource":["*"],"Effect":"Allow"}'),
      policyName?: string(name='PolicyName', description='Permission policy name.', example='AliyunComputeNestPolicyForReadOnly'),
      policyType?: string(name='PolicyType', description='Permission policy type.

- Custom: Custom policy.
- System: System policy.', example='System'),
    }
  ](name='Policies', description='Permission policy list'),
  requestId?: string(name='RequestId', description='Request ID', example='51945B04-6AA6-410D-93BA-236E0248B104'),
}

model ListPoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPoliciesResponseBody(name='body'),
}

/**
 * @summary Query Permission Policy List
 *
 * @param request ListPoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPoliciesResponse
 */
async function listPoliciesWithOptions(request: ListPoliciesRequest, runtime: $RuntimeOptions): ListPoliciesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPolicies',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query Permission Policy List
 *
 * @param request ListPoliciesRequest
 * @return ListPoliciesResponse
 */
async function listPolicies(request: ListPoliciesRequest): ListPoliciesResponse {
  var runtime = new $RuntimeOptions{};
  return listPoliciesWithOptions(request, runtime);
}

model ListServiceCategoriesResponseBody = {
  categories?: [ string ](name='Categories', description='The category list of the service.'),
  requestId?: string(name='RequestId', description='The request ID.', example='13FE89A5-C036-56BF-A0FF-A31C59819FD7'),
}

model ListServiceCategoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceCategoriesResponseBody(name='body'),
}

/**
 * @summary 查询服务类别
 *
 * @param request ListServiceCategoriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceCategoriesResponse
 */
async function listServiceCategoriesWithOptions(runtime: $RuntimeOptions): ListServiceCategoriesResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListServiceCategories',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务类别
 *
 * @return ListServiceCategoriesResponse
 */
async function listServiceCategories(): ListServiceCategoriesResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceCategoriesWithOptions(runtime);
}

model ListServiceInstanceLogsRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter. You can specify one or more filters. Valid values:

*   StartTime: the start time of the log event.
*   EndTime: the end time of the ActionTrail event.
*   EventName: the name of the ActionTrail event.
*   ResourceName: the name of the ActionTrail resource.
*   ApplicationGroupName: the name of the application group.', example='- StartTime
- EndTime
- EventName
- ResourceName
- ApplicationGroupName'),
      value?: [ string ](name='Value', description='The parameter value N of the filter. Valid values of N: 1 to 10.'),
    }
  ](name='Filter', description='The filters.'),
  logSource?: string(name='LogSource', description='The log source. When this field is empty, query logs with the source set to computeNest and ros. Valid values:

computeNest : logs of the deployment and upgrade of the service instance.
application: logs generated by the application.
actionTrail: logs generated by ActionTrail.
compliancePack: Logs originating from the compliance package.
ros: Logs originating from ROS.
meteringData：Logs originating from the pay-as-you-go model.', example='computeNest'),
  logstore?: string(name='Logstore', description='The Logstore. You must specify this parameter if you set LogSource to application.', example='logabc'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='BBBAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='The region ID. Valid values:

*   cn-hangzhou: China (Hangzhou).
*   ap-southeast-1: Singapore.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-70a3b15bb626435b****'),
  sortOrder?: string(name='SortOrder', description='The order in which you want to sort the results. Valid values:

*   Ascending
*   (Default) Descending', example='Ascending: Ascending order

Descending (default value): Descending order'),
}

model ListServiceInstanceLogsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results.', example='AAAAAfu+XtuBE55iRLHEYYuojI4='),
  requestId?: string(name='RequestId', description='The request ID.', example='51945B04-6AA6-410D-93BA-236E0248B104'),
  serviceInstancesLogs?: [ 
    {
      compliancePackType?: string(name='CompliancePackType', description='Compliance package risk types. For example, data security checks within a VPC, such as VpcDataRisk', example='VpcDataRisk'),
      complianceRuleName?: string(name='ComplianceRuleName', description='Specific risk rule names for the compliance package. For example, ECS instance migration out of VPC - ecs-move-out-vpc.', example='ecs-move-out-vpc'),
      content?: string(name='Content', description='The log content.', example='Start creating service instance'),
      logType?: string(name='LogType', description='The log type. Valid values:

*   serviceInstance: log generated by the service instance.
*   resource: log generated by ROS resources.', example='serviceInstance'),
      resourceId?: string(name='ResourceId', description='The resource ID.', example='si-5c6525c0589545c3****'),
      resourceType?: string(name='ResourceType', description='The resource type.', example='ROS.Stack'),
      source?: string(name='Source', description='The log source. Valid values:

computeNest : logs of the deployment and upgrade of the service instance.
application: logs generated by the application.
actionTrail: logs generated by ActionTrail.
compliancePack: Logs originating from the compliance package.
ros: Logs originating from ROS.
meteringData：Logs originating from the pay-as-you-go model.', example='computeNest'),
      status?: string(name='Status', description='The state of the service instance. Valid values:

*   Creating: The service instance is being created.
*   Created: The service instance is created.
*   Deploying: The service instance is being deployed.
*   Deployed: The service instance is deployed.
*   DeployedFailed: The service instance failed to be deployed.
*   Expired: The service instance expired.
*   ExtendSuccess: The service instance is renewed.
*   Upgrading: The service instance is being updated.
*   UpgradeSuccess: The service instance is updated.', example='Creating'),
      timestamp?: string(name='Timestamp', description='The timestamp of the service instance log.', example='2021-05-21T00:00:00Z'),
    }
  ](name='ServiceInstancesLogs', description='The logs of the service instance.'),
}

model ListServiceInstanceLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceInstanceLogsResponseBody(name='body'),
}

/**
 * @summary Queries the deployment and upgrade logs of a service instance.
 *
 * @param request ListServiceInstanceLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceInstanceLogsResponse
 */
async function listServiceInstanceLogsWithOptions(request: ListServiceInstanceLogsRequest, runtime: $RuntimeOptions): ListServiceInstanceLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.logSource)) {
    query['LogSource'] = request.logSource;
  }
  if (!$isNull(request.logstore)) {
    query['Logstore'] = request.logstore;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServiceInstanceLogs',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the deployment and upgrade logs of a service instance.
 *
 * @param request ListServiceInstanceLogsRequest
 * @return ListServiceInstanceLogsResponse
 */
async function listServiceInstanceLogs(request: ListServiceInstanceLogsRequest): ListServiceInstanceLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceInstanceLogsWithOptions(request, runtime);
}

model ListServiceInstanceResourcesRequest {
  filters?: [ 
    {
      name?: string(name='Name', description='Vaild values:
- ExpireTimeStart
- ExpireTimeEnd
- PayType
- ResourceARN', example='ExpireTimeStart'),
      values?: [ string ](name='Values', description='The value of the filter condition.'),
    }
  ](name='Filters', description='The filter conditions. Vaild values:

- ExpireTimeStart：
Query start time for Subscription resource expiration.
<notice>Notice Note: Only supports querying service instances on private deployments.>Notice: 

- ExpireTimeEnd：Query end time for Subscription resource expiration.
<notice>Notice Note: Only supports querying service instances on private deployments.>Notice: 

- PayType：The billing method of the read-only instance. 
<notice>Notice Note: Only supports querying service instances on private deployments.<notice> 

   Valid values:

   - PayAsYouGo

   - Subscription

- ResourceARN：The Alibaba Cloud Resource Name (ARN) of a resource.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the next query. Valid values:

*   If **NextToken** is not returned, it indicates that no additional results exist.
*   If **NextToken** was returned in the previous query, specify the value to obtain the next set of results.', example='AAAAAc3HCuYhJi/wvpk4xOr0VLbAx7BkQzyYC+ONO+WudHGKEdB0uWSY7AGnM3qCgm/Ynge7zU6NWdbj0Tegyajyqyc='),
  regionId?: string(name='RegionId', description='The region ID. Valid values:

*   cn-hangzhou: China (Hangzhou).
*   ap-southeast-1: Singapore.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-d8a0cc2a1ee04dce****'),
  serviceInstanceResourceType?: string(name='ServiceInstanceResourceType', description='Service Instance resource type，include AliyunResource and ContainerResource.', example='AliyunResource'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tag key and value.'),
}

model ListServiceInstanceResourcesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token.', example='AAAAAc3HCuYhJi/wvpk4xOr0VLbAx7BkQzyYC+ONO+WudHGKEdB0uWSY7AGnM3qCgm/Ynge7zU6NWdbj0Tegyajyqyc='),
  requestId?: string(name='RequestId', description='The request ID.', example='B288A0BE-D927-4888-B0F7-B35EF84B6E6F'),
  resources?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the resource was created.', example='2022-01-01T12:00:00'),
      expireTime?: string(name='ExpireTime', description='The time when the resource expires.', example='2022-03-01T12:00:00'),
      payType?: string(name='PayType', description='The billing method. Valid values:

*   Subscription
*   PayAsYouGo', example='Subscription'),
      productCode?: string(name='ProductCode', description='The code of the cloud service.', example='rds'),
      productType?: string(name='ProductType', description='The type of the cloud service.', example='RDS'),
      renewStatus?: string(name='RenewStatus', description='The renewal state. Valid values:

*   AutoRenewal
*   ManualRenewal
*   NotRenewal', example='AutoRenewal'),
      renewalPeriod?: int32(name='RenewalPeriod', description='The renewal period.', example='1'),
      renewalPeriodUnit?: string(name='RenewalPeriodUnit', description='The unit of the renewal period. Valid values:

*   Month
*   Year', example='Month'),
      resourceARN?: string(name='ResourceARN', description='The ARN of the resource.', example='arn:acs:sag:cn-hangzhou:130920852836****:ccn/ccn-b3qf0q439sq2de****'),
      status?: string(name='Status', description='The state of the resource. Valid values:

*   running
*   waiting
*   terminated

>  This parameter is returned only for containers.', example='running'),
    }
  ](name='Resources', description='The resources.'),
}

model ListServiceInstanceResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceInstanceResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the resources contained in a service instance.
 *
 * @param request ListServiceInstanceResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceInstanceResourcesResponse
 */
async function listServiceInstanceResourcesWithOptions(request: ListServiceInstanceResourcesRequest, runtime: $RuntimeOptions): ListServiceInstanceResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.serviceInstanceResourceType)) {
    query['ServiceInstanceResourceType'] = request.serviceInstanceResourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServiceInstanceResources',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resources contained in a service instance.
 *
 * @param request ListServiceInstanceResourcesRequest
 * @return ListServiceInstanceResourcesResponse
 */
async function listServiceInstanceResources(request: ListServiceInstanceResourcesRequest): ListServiceInstanceResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceInstanceResourcesWithOptions(request, runtime);
}

model ListServiceInstanceUpgradeHistoryRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='BBBAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-70a3b15bb62643xxxxxx'),
}

model ListServiceInstanceUpgradeHistoryResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAfu+XtuBE55iRLHEYYuojI41'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE3EDF4E-B3B1-19B6-BD01-30D4D00F6E5D'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='2'),
  upgradeHistory?: [ 
    {
      endTime?: string(name='EndTime', description='The time when the update ended.', example='2022-04-26T09:09:51Z'),
      fromVersion?: string(name='FromVersion', description='The version before the upgrade.', example='1'),
      results?: string(name='Results', description='The upgrade result.', example='{\\\\"PreUpgradeExecutionId\\\\":\\\\"exec-123\\\\"}'),
      startTime?: string(name='StartTime', description='The time when the update started.', example='2022-04-26T08:09:51Z'),
      status?: string(name='Status', description='The state of the update. Valid values:

*   upgrading: The service instance is being upgraded.
*   UpgradeSuccessful: The service instance is upgraded.
*   UpgradeFailed: The service instance failed to be upgraded.', example='UpgradeFailed'),
      toVersion?: string(name='ToVersion', description='The version after the upgrade.', example='3'),
      type?: string(name='Type', description='The update type.', example='Upgrade'),
      upgradeHistoryId?: string(name='UpgradeHistoryId', description='The ID of the upgrade record.', example='exec-123'),
    }
  ](name='UpgradeHistory', description='The upgrade history.'),
}

model ListServiceInstanceUpgradeHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceInstanceUpgradeHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the upgrade history of a service instance.
 *
 * @param request ListServiceInstanceUpgradeHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceInstanceUpgradeHistoryResponse
 */
async function listServiceInstanceUpgradeHistoryWithOptions(request: ListServiceInstanceUpgradeHistoryRequest, runtime: $RuntimeOptions): ListServiceInstanceUpgradeHistoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServiceInstanceUpgradeHistory',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the upgrade history of a service instance.
 *
 * @param request ListServiceInstanceUpgradeHistoryRequest
 * @return ListServiceInstanceUpgradeHistoryResponse
 */
async function listServiceInstanceUpgradeHistory(request: ListServiceInstanceUpgradeHistoryRequest): ListServiceInstanceUpgradeHistoryResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceInstanceUpgradeHistoryWithOptions(request, runtime);
}

model ListServiceInstancesRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter. You can specify one or more parameter names to query services. Valid values:

- Name：Query by service name.
- ServiceInstanceName：Query by service  instance name.
- ServiceInstanceId：Query by service  instance ID.
- ServiceId：Query by service ID.
- Version：Query by service version.
- Status：Query by service status.
- DeployType: Query by service deployType.
- ServiceType：Query by service deployType.', example='ServiceInstanceId'),
      value?: [ string ](name='Value', description='The parameter values of the filter.'),
    }
  ](name='Filter', description='The filter.'),
  maxResults?: int32(name='MaxResults', description='The number of entries page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='BBBAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-bp67acfmxazb4p****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tag key and value.'),
}

model ListServiceInstancesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token.', example='AAAAAfu+XtuBE55iRLHEYYuojI4='),
  requestId?: string(name='RequestId', description='The request ID.', example='E50287CB-AABF-4877-92C0-289B339A1546'),
  serviceInstances?: [ 
    {
      bizStatus?: string(name='BizStatus', description='The business state of the service instance. Valid values:

*   Normal
*   Renewing
*   RenewFailed
*   Expired', example='Normal'),
      createTime?: string(name='CreateTime', description='The time when the service instance was created.', example='2021-05-20T00:00:00Z'),
      enableInstanceOps?: boolean(name='EnableInstanceOps', description='Indicates whether the service instance supports the hosted O\\\\&M feature. Valid values:

*   true
*   false', example='true'),
      endTime?: string(name='EndTime', description='The time when the service instance expires.', example='2022-01-01T12:00:00'),
      marketInstanceId?: string(name='MarketInstanceId', description='The ID of the Alibaba Cloud Marketplace instance.', example='5827****'),
      name?: string(name='Name', description='The name of the service instance.', example='TestName'),
      operatedServiceInstanceId?: string(name='OperatedServiceInstanceId', description='The ID of the managed service instance.', example='si-d6ab3a63ccbb4b17****'),
      operationEndTime?: string(name='OperationEndTime', description='The end of the time range during which hosted O\\\\&M is implemented.', example='2022-01-28T06:48:56Z'),
      operationStartTime?: string(name='OperationStartTime', description='The beginning of the time range during which hosted O\\\\&M is implemented.', example='2021-12-29T06:48:56Z'),
      orderId?: string(name='OrderId', description='The order ID.', example='2306175xxxxxxxx'),
      outputs?: string(name='Outputs', description='The information returned after the service instance is created.', example='{"managementUrl": "http://xx.xx"}'),
      parameters?: string(name='Parameters', description='The parameters of the service instance.', example='{"param":"value"}'),
      payType?: string(name='PayType', description='The billing method. Valid values:

*   Permanent: Once you purchase the service, you can use it permanently.
*   Subscription: You purchase the service from Alibaba Cloud Marketplace and are charged for the service on a subscription basis.
*   PayAsYouGo: You purchase the service from Alibaba Cloud Marketplace and are charged for the service on a pay-as-you-go basis.
*   CustomFixTime: You are charged for the service based on a custom duration fixed by the service provider.', example='Subscription'),
      progress?: long(name='Progress', description='The deployment progress of the service instance, in percentage.', example='90'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekz6scpcxxxxxx'),
      resources?: string(name='Resources', description='The resources.', example='[{"StackId": "stack-xxx"}]'),
      service?: {
        commodity?: {
          saasBoostMetadata?: string(name='SaasBoostMetadata', description='The configuration metadata related to SaaS Boost.', example='{ // Specifies whether to associate the service with the SaaS Boost commodity. Default value: false. "Enabled":true/false // The public endpoint of the SaaS Boost instance. "PublicAccessUrl":"https://example.com" }'),
          type?: string(name='Type', description='The platform type. Valid values:

*   marketplace: Alibaba Cloud Marketplace.
*   Css: Lingxiao.
*   SaasBoost: SaaS Boost.', example='Marketplace'),
        }(name='Commodity', description='The commodity details.'),
        deployType?: string(name='DeployType', description='The deployment type of the service. Valid values:

*   ros: The service is deployed by using Resource Orchestration Service (ROS).
*   terraform: The service is deployed by using Terraform.
*   ack: The service is deployed by using Alibaba Cloud Container Service for Kubernetes (ACK).
*   spi: The service is deployed by calling the Service Provider Interface (SPI).
*   operation: The service is deployed by using a hosted O\\\\&M service.', example='ros'),
        publishTime?: string(name='PublishTime', description='The time when the service was published.', example='2021-05-21T00:00:00Z'),
        serviceId?: string(name='ServiceId', description='The service ID.', example='service-0e6fca6a51a54420****'),
        serviceInfos?: [ 
          {
            image?: string(name='Image', description='The URL of the service icon.', example='https://example.com/service-image/c1c4a559-cc60-4af1-b976-98f356602462.png'),
            locale?: string(name='Locale', description='The language of the service instance.', example='zh-CN'),
            name?: string(name='Name', description='The name of the service.', example='wordpress'),
            shortDescription?: string(name='ShortDescription', description='The description of the service.', example='B是A公司自主设计并研发的开源分布式的关系型数据库'),
          }
        ](name='ServiceInfos', description='The information about the service.'),
        serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

*   private: The service is a private service and is deployed within the account of a customer.
*   managed: The service is a fully managed service and is deployed within the account of a service provider.
*   operation: The service is a hosted O\\\\&M service.', example='private'),
        status?: string(name='Status', description='The service state.', example='Online'),
        supplierName?: string(name='SupplierName', description='The name of the service provider.', example='Alibaba Cloud'),
        supplierUrl?: string(name='SupplierUrl', description='The URL of the service provider.', example='http://example.com'),
        version?: string(name='Version', description='The service version.', example='1.0'),
        versionName?: string(name='VersionName', description='The custom version name defined by the service provider.', example='1.1.0'),
      }(name='Service', description='The services.'),
      serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-d6ab3a63ccbb4b17****'),
      serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

*   private: The service is a private service and is deployed within the account of a customer.
*   managed: The service is a fully managed service and is deployed within the account of a service provider.
*   operation: The service is a hosted O\\\\&M service.
*   poc: The service is a trial service.', example='private'),
      source?: string(name='Source', description='The source from which the service instance is created.', example='Supplier'),
      status?: string(name='Status', description='The state of the service instance. Valid values:

*   Created
*   Deploying
*   DeployedFailed
*   Deployed
*   Upgrading
*   Deleting
*   Deleted
*   DeletedFailed', example='Deployed'),
      statusDetail?: string(name='StatusDetail', description='The description of the deployment of the service instance.', example='deploy successfully'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='key1'),
          value?: string(name='Value', description='The tag value.', example='value1'),
        }
      ](name='Tags', description='The custom tags.'),
      templateName?: string(name='TemplateName', description='The template name.', example='模板1'),
      updateTime?: string(name='UpdateTime', description='The time when the service instance was updated.', example='2021-05-20T00:00:00Z'),
    }
  ](name='ServiceInstances', description='The information about the service instances.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model ListServiceInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceInstancesResponseBody(name='body'),
}

/**
 * @summary {}
 *
 * @param request ListServiceInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceInstancesResponse
 */
async function listServiceInstancesWithOptions(request: ListServiceInstancesRequest, runtime: $RuntimeOptions): ListServiceInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServiceInstances',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary {}
 *
 * @param request ListServiceInstancesRequest
 * @return ListServiceInstancesResponse
 */
async function listServiceInstances(request: ListServiceInstancesRequest): ListServiceInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceInstancesWithOptions(request, runtime);
}

model ListServiceUsagesRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter. You can specify one or more filters. Valid values:

*   ServiceId: the ID of the service.
*   ServiceName: the service name.
*   Status: the state of the service.
*   SupplierName: the name of the service provider.', example='ServiceId'),
      value?: [ string ](name='Value', description='The parameter values of the filter.'),
    }
  ](name='Filter', description='The filters.'),
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='AAAAAWns8w4MmhzeptXVRG0PUEU='),
}

model ListServiceUsagesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The maximum number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAYChudnQUoBH+mGWFpb6oP0='),
  requestId?: string(name='RequestId', description='The request ID.', example='18AD0960-A9FE-1AC8-ADF8-22131Fxxxxxx'),
  serviceUsages?: [ 
    {
      comments?: string(name='Comments', description='The review comment.', example='Approved'),
      createTime?: string(name='CreateTime', description='The time when the application was created.', example='2022-05-25T02:02:02Z'),
      serviceId?: string(name='ServiceId', description='The service ID.', example='service-c9f36ec6d19b4exxxxxx'),
      serviceName?: string(name='ServiceName', description='The service name.', example='LobelChat'),
      status?: string(name='Status', description='The state of the service application. Valid values:

*   Submitted: The application is submitted for review.
*   Approved: The application is approved.
*   Rejected: The application is rejected.
*   Canceled: The application is canceled.', example='Submitted'),
      supplierName?: string(name='SupplierName', description='The name of the service provider.', example='TestSupplier'),
      updateTime?: string(name='UpdateTime', description='The time when the application was updated.', example='2022-05-25T02:02:02Z'),
      userAliUid?: long(name='UserAliUid', description='The ID of the Alibaba Cloud account.', example='127383705958xxxx'),
      userInformation?: map[string]string(name='UserInformation', description='The information about the applicants.'),
    }
  ](name='ServiceUsages', description='The service applications.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model ListServiceUsagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceUsagesResponseBody(name='body'),
}

/**
 * @summary Queries the applications for using a service.
 *
 * @param request ListServiceUsagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceUsagesResponse
 */
async function listServiceUsagesWithOptions(request: ListServiceUsagesRequest, runtime: $RuntimeOptions): ListServiceUsagesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServiceUsages',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the applications for using a service.
 *
 * @param request ListServiceUsagesRequest
 * @return ListServiceUsagesResponse
 */
async function listServiceUsages(request: ListServiceUsagesRequest): ListServiceUsagesResponse {
  var runtime = new $RuntimeOptions{};
  return listServiceUsagesWithOptions(request, runtime);
}

model ListServicesRequest {
  filter?: [ 
    {
      name?: string(name='Name', description='The parameter name of the filter. You can specify one or more parameter names to query services. Valid values:

*   ServiceId: the ID of the service.
*   Name: the name of the service.
*   Status: the state of the service.
*   SupplierName: the name of the service provider.', example='Status'),
      value?: [ string ](name='Value', description='A value of the filter condition.'),
    }
  ](name='Filter', description='The filter.'),
  fuzzyKeyword?: string(name='FuzzyKeyword', description='Keyword fuzzy query.', example='name'),
  inUsed?: boolean(name='InUsed', description='Whether it is used. Optional values:



- false: not being used.



- true: already in use.', example='false'),
  maxResults?: int32(name='MaxResults', description='The number of entries page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='BBBAAfu+XtuBE55iRLHEYYuojI4='),
  orderByType?: string(name='OrderByType', description='Service ordering type.', example='UpdateTime'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceAccessType?: string(name='ServiceAccessType', description='Service access type.', example='All'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tags.'),
}

model ListServicesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token.', example='AAAAAfu+XtuBE55iRLHEYYuojI41'),
  requestId?: string(name='RequestId', description='The request ID.', example='3F976EF8-C10A-57DC-917C-BB7BEB508FFB'),
  services?: [ 
    {
      categories?: string(name='Categories', description='The category of the service.', example='cloud_ssd'),
      commodity?: {
        commodityCode?: string(name='CommodityCode', description='The commodity code.', example='cmjj00****'),
        deployPage?: string(name='DeployPage', description='Deploy Page.', example='Order： Order Page
Detail： Detail Page'),
      }(name='Commodity', description='The commodity details.'),
      commodityCode?: string(name='CommodityCode', description='The commodity code of the service in Alibaba Cloud Marketplace.', example='cmjj00xxxx'),
      deployFrom?: string(name='DeployFrom', description='Service deployment approach. Valid values:
- NoWhere

- Marketplace

- ComputeNest', example='ComputeNest'),
      deployType?: string(name='DeployType', description='The deployment type of the service. Valid values:

*   ros: The service is deployed by using Resource Orchestration Service (ROS).
*   terraform: The service is deployed by using Terraform.', example='ros'),
      publishTime?: string(name='PublishTime', description='The time when the service was published.', example='2022-01-21T10:35:44Z'),
      score?: int32(name='Score', description='Service recommendation score.', example='5'),
      serviceId?: string(name='ServiceId', description='The service ID.', example='service-6b5d632edd394dxxxxxx'),
      serviceInfos?: [ 
        {
          image?: string(name='Image', description='The URL of the service icon.', example='http://img.tidb.oss.url'),
          locale?: string(name='Locale', description='The language of the service. Valid values:

*   zh-CN: Chinese.
*   en-US: English.', example='zh-CN'),
          name?: string(name='Name', description='The name of the service.', example='Docker Community Edition'),
          shortDescription?: string(name='ShortDescription', description='The description of the service.', example='Docker Community Edition (CE) is a free version of the Docker project, aimed at developers, enthusiasts, and individuals and organizations who want to use container technology.'),
        }
      ](name='ServiceInfos', description='The information about the service.'),
      serviceProductUrl?: string(name='ServiceProductUrl', description='The URL of the service page.', example='http://example1.com'),
      serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

- private: The service is a private service and is deployed within the account of a customer.
- managed: The service is a fully managed service and is deployed within the account of a service provider.
- operation: The service is a hosted O&M service.', example='private'),
      status?: string(name='Status', description='The state of the service. Valid values:

*   Draft: The service is a draft.
*   Submitted: The service is submitted for review. You cannot modify services in this state.
*   Approved: The service is approved. You cannot modify services in this state. You can publish services in this state.
*   Launching: The service is being published.
*   Online: The service is published.
*   Offline: The service is unpublished.', example='Online'),
      supplierName?: string(name='SupplierName', description='The name of the service provider.', example='Alibaba Cloud'),
      supplierNameEng?: string(name='SupplierNameEng', description='The name of service provider.', example='Alibaba Cloud'),
      supplierUid?: long(name='SupplierUid', description='The Alibaba Cloud account ID of the service provider.', example='1436322xxxxx'),
      supplierUrl?: string(name='SupplierUrl', description='The URL of the service provider.', example='http://example.com'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.

>  This parameter is required.', example='key1'),
          value?: string(name='Value', description='The tag value.', example='value1'),
        }
      ](name='Tags', description='The tags.'),
      tenantType?: string(name='TenantType', description='The tenant type of the managed service. Valid values:

*   SingleTenant
*   MultiTenant', example='SingleTenant'),
      trialDuration?: string(name='TrialDuration', description='The trial duration. Unit: day. The maximum trial duration cannot exceed 30 days.', example='7'),
      trialType?: string(name='TrialType', description='The trial policy. Valid values:

*   Trial: Trials are supported.
*   NotTrial: Trials are not supported.', example='Trial'),
      version?: string(name='Version', description='The version of the service.', example='4'),
      versionName?: string(name='VersionName', description='The custom version name defined by the service provider.', example='v2.0.0'),
      virtualInternetService?: string(name='VirtualInternetService', description='Indicates whether the service is a virtual Internet service. Valid values:

*   false
*   true', example='false'),
    }
  ](name='Services', description='The services.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServicesResponseBody(name='body'),
}

/**
 * @summary Queries a list of services.
 *
 * @param request ListServicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServicesResponse
 */
async function listServicesWithOptions(request: ListServicesRequest, runtime: $RuntimeOptions): ListServicesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.fuzzyKeyword)) {
    query['FuzzyKeyword'] = request.fuzzyKeyword;
  }
  if (!$isNull(request.inUsed)) {
    query['InUsed'] = request.inUsed;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.orderByType)) {
    query['OrderByType'] = request.orderByType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceAccessType)) {
    query['ServiceAccessType'] = request.serviceAccessType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServices',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of services.
 *
 * @param request ListServicesRequest
 * @return ListServicesResponse
 */
async function listServices(request: ListServicesRequest): ListServicesResponse {
  var runtime = new $RuntimeOptions{};
  return listServicesWithOptions(request, runtime);
}

model ListTagKeysRequest {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact
*   dataset: dataset

This parameter is required.', example='service'),
}

model ListTagKeysResponseBody = {
  keys?: [ string ](name='Keys', description='Details of the tag keys.'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAZ9FmxgN6wKfeK/GOKRnnjU='),
  requestId?: string(name='RequestId', description='The request ID.', example='8872ACE6-0297-54A4-8AAD-3A8623EC6C5D'),
}

model ListTagKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagKeysResponseBody(name='body'),
}

/**
 * @summary 查询标签键列表
 *
 * @param request ListTagKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagKeysResponse
 */
async function listTagKeysWithOptions(request: ListTagKeysRequest, runtime: $RuntimeOptions): ListTagKeysResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagKeys',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询标签键列表
 *
 * @param request ListTagKeysRequest
 * @return ListTagKeysResponse
 */
async function listTagKeys(request: ListTagKeysRequest): ListTagKeysResponse {
  var runtime = new $RuntimeOptions{};
  return listTagKeysWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAfu+XtuBE55iRLHEYYuojI4='),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs. You can specify up to 50 resource IDs.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact

This parameter is required.', example='service'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='key1'),
      value?: string(name='Value', description='The tag value.', example='value1'),
    }
  ](name='Tag', description='The tags.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAVz7BQqj2xtiNSC3d3RAD38='),
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID.', example='si-44b9923be2d048eb8f5f'),
      resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact', example='serviceinstance'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='test'),
      tagValue?: string(name='TagValue', description='The values of the tags.', example='major'),
    }
  ](name='TagResources', description='A list of resources that have tags.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary 查询标签资源列表
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询标签资源列表
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ListTagValuesRequest {
  key?: string(name='Key', description='The tag key.

>  This parameter is required.

This parameter is required.', example='ECS'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAfmTH5rcd4YFfob4P0uDAAc='),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact
*   dataset: dataset

This parameter is required.', example='service'),
}

model ListTagValuesResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='AAAAAVz7BQqj2xtiNSC3d3RAD38='),
  requestId?: string(name='RequestId', description='The request ID.', example='0631D623-D917-1C2D-ACD6-5B3B19XXXXXX'),
  values?: [ string ](name='Values', description='The information of the tag values.'),
}

model ListTagValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagValuesResponseBody(name='body'),
}

/**
 * @summary 查询标签值列表
 *
 * @param request ListTagValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagValuesResponse
 */
async function listTagValuesWithOptions(request: ListTagValuesRequest, runtime: $RuntimeOptions): ListTagValuesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagValues',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询标签值列表
 *
 * @param request ListTagValuesRequest
 * @return ListTagValuesResponse
 */
async function listTagValues(request: ListTagValuesRequest): ListTagValuesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagValuesWithOptions(request, runtime);
}

model RenewServiceInstanceResourcesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  period?: int32(name='Period', description='The renewal duration for all prepaid resources in the service instance. The unit is specified by PeriodUnit.', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The time unit for the renewal duration of all prepaid resources in the service instance, which is the unit for the Period parameter. Valid values: Month, Year. Default value: Month.', example='Month'),
  regionId?: string(name='RegionId', description='Region ID.', example='cn-hangzhou'),
  resourcePeriod?: [ 
    {
      period?: int32(name='Period', description='The renewal duration for the resource. The unit is specified by PeriodUnit.', example='1'),
      periodUnit?: string(name='PeriodUnit', description='The time unit for the renewal duration of the resource, which is the unit for the Period parameter. Valid values: Month, Year. Default value: Month.', example='Month'),
      resourceArn?: string(name='ResourceArn', description='Resource ARN (Aliyun Resource Name).', example='acs:ecs:cn-hongkong:1488317743351199:instance/i-j6c6f3lbky38o8rpeqw2'),
    }
  ](name='ResourcePeriod', description='List of resource renewals.'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='Service instance ID.

This parameter is required.', example='si-b58c874912fc4294****'),
}

model RenewServiceInstanceResourcesResponseBody = {
  failureDetails?: [ 
    {
      errorCode?: string(name='ErrorCode', description='Error code.', example='InvalidPeriod'),
      errorMessage?: string(name='ErrorMessage', description='Error message.', example='Error message'),
      resourceArn?: string(name='ResourceArn', description='Resource ARN (Aliyun Resource Name).', example='acs:ecs:cn-hongkong:1488317743351199:instance/i-j6c6f3lbky38o8rpeqw2'),
    }
  ](name='FailureDetails', description='Details of failed renewals.'),
  renewalResult?: {
    failed?: int32(name='Failed', description='Number of failed renewals.', example='1'),
    succeeded?: int32(name='Succeeded', description='Number of successfully renewed resources.', example='9'),
    totalCount?: int32(name='TotalCount', description='Number of renewed resources.', example='10'),
  }(name='RenewalResult', description='Renewal result.'),
  requestId?: string(name='RequestId', description='Request ID.', example='13FE89A5-C036-56BF-A0FF-A31C59819FD7'),
}

model RenewServiceInstanceResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewServiceInstanceResourcesResponseBody(name='body'),
}

/**
 * @summary Renew the prepaid resources included in the private deployment service instance. You can renew all prepaid resources under the specified service instance ID, or you can renew the specified resources. Only one of the two renewal methods can be used.
 *
 * @param request RenewServiceInstanceResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewServiceInstanceResourcesResponse
 */
async function renewServiceInstanceResourcesWithOptions(request: RenewServiceInstanceResourcesRequest, runtime: $RuntimeOptions): RenewServiceInstanceResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourcePeriod)) {
    query['ResourcePeriod'] = request.resourcePeriod;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RenewServiceInstanceResources',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Renew the prepaid resources included in the private deployment service instance. You can renew all prepaid resources under the specified service instance ID, or you can renew the specified resources. Only one of the two renewal methods can be used.
 *
 * @param request RenewServiceInstanceResourcesRequest
 * @return RenewServiceInstanceResourcesResponse
 */
async function renewServiceInstanceResources(request: RenewServiceInstanceResourcesRequest): RenewServiceInstanceResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return renewServiceInstanceResourcesWithOptions(request, runtime);
}

model RestartServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-42665544****'),
  regionId?: string(name='RegionId', description='The region ID where the service instance resides.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-d6ab3a63ccbb4b17****'),
}

model RestartServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='13FE89A5-C036-56BF-A0FF-A31C59819FD7'),
}

model RestartServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartServiceInstanceResponseBody(name='body'),
}

/**
 * @summary When the service instance is Deployed, call the RestartServiceInstance interface to restart the service instance.
 *
 * @param request RestartServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartServiceInstanceResponse
 */
async function restartServiceInstanceWithOptions(request: RestartServiceInstanceRequest, runtime: $RuntimeOptions): RestartServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary When the service instance is Deployed, call the RestartServiceInstance interface to restart the service instance.
 *
 * @param request RestartServiceInstanceRequest
 * @return RestartServiceInstanceResponse
 */
async function restartServiceInstance(request: RestartServiceInstanceRequest): RestartServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restartServiceInstanceWithOptions(request, runtime);
}

model RollbackServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The service instance ID.', example='si-d6ab3a63ccbb4bxxxxxx'),
}

model RollbackServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model RollbackServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RollbackServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Rolls back an upgraded service instance to the previous version.
 *
 * @param request RollbackServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RollbackServiceInstanceResponse
 */
async function rollbackServiceInstanceWithOptions(request: RollbackServiceInstanceRequest, runtime: $RuntimeOptions): RollbackServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RollbackServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Rolls back an upgraded service instance to the previous version.
 *
 * @param request RollbackServiceInstanceRequest
 * @return RollbackServiceInstanceResponse
 */
async function rollbackServiceInstance(request: RollbackServiceInstanceRequest): RollbackServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return rollbackServiceInstanceWithOptions(request, runtime);
}

model StartServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-42665544****'),
  regionId?: string(name='RegionId', description='The region ID where the service instance resides.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-d6ab3a63ccbb4b17****'),
}

model StartServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='464C8CB6-A548-5206-B83C-D32A8E43EC21'),
}

model StartServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartServiceInstanceResponseBody(name='body'),
}

/**
 * @summary When the service instance status is Stopped (Stopped) or StartFailed (Startup failed), the StartServiceInstance interface is invoked to start the service instance.
 *
 * @param request StartServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartServiceInstanceResponse
 */
async function startServiceInstanceWithOptions(request: StartServiceInstanceRequest, runtime: $RuntimeOptions): StartServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary When the service instance status is Stopped (Stopped) or StartFailed (Startup failed), the StartServiceInstance interface is invoked to start the service instance.
 *
 * @param request StartServiceInstanceRequest
 * @return StartServiceInstanceResponse
 */
async function startServiceInstance(request: StartServiceInstanceRequest): StartServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return startServiceInstanceWithOptions(request, runtime);
}

model StopServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.', example='123e4567-e89b-12d3-a456-42665544****'),
  regionId?: string(name='RegionId', description='The region where the service instance resides.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

This parameter is required.', example='si-b58c874912fc4294****'),
}

model StopServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model StopServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopServiceInstanceResponseBody(name='body'),
}

/**
 * @summary When the service instance is Deployed and StopFailed, call the StopServiceInstance interface to stop the service instance.
 *
 * @param request StopServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopServiceInstanceResponse
 */
async function stopServiceInstanceWithOptions(request: StopServiceInstanceRequest, runtime: $RuntimeOptions): StopServiceInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary When the service instance is Deployed and StopFailed, call the StopServiceInstance interface to stop the service instance.
 *
 * @param request StopServiceInstanceRequest
 * @return StopServiceInstanceResponse
 */
async function stopServiceInstance(request: StopServiceInstanceRequest): StopServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return stopServiceInstanceWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs. You can specify up to 50 resource IDs.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact
*   dataset: dataset

This parameter is required.', example='service'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='Key1'),
      value?: string(name='Value', description='The tag value.', example='Value1'),
    }
  ](name='Tag', description='The tag key and value.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary 给资源打标签
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 给资源打标签
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UnTagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the resource. Valid values:

*   true: All tags are removed from the resource.
*   false (default): The specified tags are removed from the resource.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The resource ID.

You can remove tags from up to 50 resources at a time.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   service: service
*   serviceinstance: service instance
*   artifact: artifact
*   dataset: dataset

This parameter is required.', example='service'),
  tagKey?: [ string ](name='TagKey', description='The tag keys.

You can specify a maximum of 20 tag keys.

> If you set the `All` parameter to `true`, you do not need to specify tag keys.'),
}

model UnTagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model UnTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnTagResourcesResponseBody(name='body'),
}

/**
 * @summary 给资源解除标签
 *
 * @param request UnTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnTagResourcesResponse
 */
async function unTagResourcesWithOptions(request: UnTagResourcesRequest, runtime: $RuntimeOptions): UnTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnTagResources',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 给资源解除标签
 *
 * @param request UnTagResourcesRequest
 * @return UnTagResourcesResponse
 */
async function unTagResources(request: UnTagResourcesRequest): UnTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return unTagResourcesWithOptions(request, runtime);
}

model UpdateServiceInstanceAttributesRequest {
  enableOperation?: boolean(name='EnableOperation', description='Specifies whether to authorize the service provider to perform O\\\\&M operations on the service instance.', example='true'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

You can call the [ListServiceInstances](https://help.aliyun.com/document_detail/396200.html) operation to obtain the ID of the service instance.

This parameter is required.', example='si-d6ab3a63ccbb4b17xxxx'),
}

model UpdateServiceInstanceAttributesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model UpdateServiceInstanceAttributesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceInstanceAttributesResponseBody(name='body'),
}

/**
 * @summary Updates the attributes of a service instance.
 *
 * @param request UpdateServiceInstanceAttributesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceInstanceAttributesResponse
 */
async function updateServiceInstanceAttributesWithOptions(request: UpdateServiceInstanceAttributesRequest, runtime: $RuntimeOptions): UpdateServiceInstanceAttributesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.enableOperation)) {
    query['EnableOperation'] = request.enableOperation;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServiceInstanceAttributes',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the attributes of a service instance.
 *
 * @param request UpdateServiceInstanceAttributesRequest
 * @return UpdateServiceInstanceAttributesResponse
 */
async function updateServiceInstanceAttributes(request: UpdateServiceInstanceAttributesRequest): UpdateServiceInstanceAttributesResponse {
  var runtime = new $RuntimeOptions{};
  return updateServiceInstanceAttributesWithOptions(request, runtime);
}

model UpdateServiceInstanceSpecRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-42665544****'),
  commodity?: {
    autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment.

Valid values:

*   **true (default)**: automatically completes the payment. You must make sure that your account balance is sufficient.
*   **false**: does not automatically complete the payment. An unpaid order is generated. If your account balance is insufficient, you can set AutoPay to false. In this case, an unpaid order is generated. You can complete the payment in the Expenses and Costs console.[](https://rdsnext.console.aliyun.com/dashboard/cn-beijing)', example='true'),
  }(name='Commodity', description='The information about the order placed in Alibaba Cloud Marketplace. You do not need to specify this parameter if the service is not published in Alibaba Cloud Marketplace or uses the pay-as-you-go billing method.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. A dry run includes checks on the permissions and instance state.

Valid values:

*   true: performs a dry run but does not create a service instance.
*   false: performs a dry run and creates a service instance if the request passes the dry run.', example='true'),
  enableUserPrometheus?: boolean(name='EnableUserPrometheus', description='Specifies whether to enable Prometheus monitoring on the user side.

Valid values:

true

false', example='true'),
  operationName?: string(name='OperationName', description='The name of the configuration change operation.

To obtain the names and content of the configuration change operations of the service, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **ModifyParametersConfig** in the value of **OperationMetadata**.', example='package modify'),
  parameters?: map[string]any(name='Parameters', description='The configuration parameter.

This parameter is available if the service provider set **Method** to **Change Parameter** when configuring configuration change operations.

> 

*   To obtain the parameters of the service that support configuration change, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **ModifyParametersConfig** in the value of **OperationMetadata**.

*   You can also view the parameters of the service that support configuration change in the **configuration change** dialog box in the [Compute Nest console](https://computenest.console.aliyun.com/service/instance/cn-hangzhou).

For example, if the service supports Elastic Compute Service (ECS) instance type upgrade, you must specify an instance type that has higher specifications than the current one.', example='{
  "InstanceType": "ecs.g8ise.2xlarge"
}'),
  predefinedParametersName?: string(name='PredefinedParametersName', description='The name of the configuration plan.

This parameter is available if the service provider set **Method** to **Change Plan** when configuring configuration change operations.

To obtain the configuration plan names of the service, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **PredefinedParameters** in the value of **DeployMetadata**.', example='package One'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

You can call the [ListServiceInstances](https://help.aliyun.com/document_detail/396200.html) operation to obtain the ID of the service instance.

This parameter is required.', example='si-d6ab3a63ccbb4b17****'),
}

model UpdateServiceInstanceSpecShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-42665544****'),
  commodity?: {
    autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment.

Valid values:

*   **true (default)**: automatically completes the payment. You must make sure that your account balance is sufficient.
*   **false**: does not automatically complete the payment. An unpaid order is generated. If your account balance is insufficient, you can set AutoPay to false. In this case, an unpaid order is generated. You can complete the payment in the Expenses and Costs console.[](https://rdsnext.console.aliyun.com/dashboard/cn-beijing)', example='true'),
  }(name='Commodity', description='The information about the order placed in Alibaba Cloud Marketplace. You do not need to specify this parameter if the service is not published in Alibaba Cloud Marketplace or uses the pay-as-you-go billing method.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run, without performing the actual request. A dry run includes checks on the permissions and instance state.

Valid values:

*   true: performs a dry run but does not create a service instance.
*   false: performs a dry run and creates a service instance if the request passes the dry run.', example='true'),
  enableUserPrometheus?: boolean(name='EnableUserPrometheus', description='Specifies whether to enable Prometheus monitoring on the user side.

Valid values:

true

false', example='true'),
  operationName?: string(name='OperationName', description='The name of the configuration change operation.

To obtain the names and content of the configuration change operations of the service, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **ModifyParametersConfig** in the value of **OperationMetadata**.', example='package modify'),
  parametersShrink?: string(name='Parameters', description='The configuration parameter.

This parameter is available if the service provider set **Method** to **Change Parameter** when configuring configuration change operations.

> 

*   To obtain the parameters of the service that support configuration change, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **ModifyParametersConfig** in the value of **OperationMetadata**.

*   You can also view the parameters of the service that support configuration change in the **configuration change** dialog box in the [Compute Nest console](https://computenest.console.aliyun.com/service/instance/cn-hangzhou).

For example, if the service supports Elastic Compute Service (ECS) instance type upgrade, you must specify an instance type that has higher specifications than the current one.', example='{
  "InstanceType": "ecs.g8ise.2xlarge"
}'),
  predefinedParametersName?: string(name='PredefinedParametersName', description='The name of the configuration plan.

This parameter is available if the service provider set **Method** to **Change Plan** when configuring configuration change operations.

To obtain the configuration plan names of the service, you can call the [GetService](https://help.aliyun.com/document_detail/2340828.html) operation. In the response, check the value of **PredefinedParameters** in the value of **DeployMetadata**.', example='package One'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.

You can call the [ListServiceInstances](https://help.aliyun.com/document_detail/396200.html) operation to obtain the ID of the service instance.

This parameter is required.', example='si-d6ab3a63ccbb4b17****'),
}

model UpdateServiceInstanceSpecResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='23396265896****'),
  requestId?: string(name='RequestId', description='The request ID.', example='06BF8F22-02DC-4750-83DF-3FFC11C065EA'),
}

model UpdateServiceInstanceSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceInstanceSpecResponseBody(name='body'),
}

/**
 * @summary Changes the configurations of a service instance.
 *
 * @description ### [](#)Prerequisites
 * Configuration change is enabled and the related parameters are configured for the service by the service provider.
 *
 * @param tmpReq UpdateServiceInstanceSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceInstanceSpecResponse
 */
async function updateServiceInstanceSpecWithOptions(tmpReq: UpdateServiceInstanceSpecRequest, runtime: $RuntimeOptions): UpdateServiceInstanceSpecResponse {
  tmpReq.validate();
  var request = new UpdateServiceInstanceSpecShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.commodity)) {
    query['Commodity'] = request.commodity;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.enableUserPrometheus)) {
    query['EnableUserPrometheus'] = request.enableUserPrometheus;
  }
  if (!$isNull(request.operationName)) {
    query['OperationName'] = request.operationName;
  }
  if (!$isNull(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!$isNull(request.predefinedParametersName)) {
    query['PredefinedParametersName'] = request.predefinedParametersName;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServiceInstanceSpec',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the configurations of a service instance.
 *
 * @description ### [](#)Prerequisites
 * Configuration change is enabled and the related parameters are configured for the service by the service provider.
 *
 * @param request UpdateServiceInstanceSpecRequest
 * @return UpdateServiceInstanceSpecResponse
 */
async function updateServiceInstanceSpec(request: UpdateServiceInstanceSpecRequest): UpdateServiceInstanceSpecResponse {
  var runtime = new $RuntimeOptions{};
  return updateServiceInstanceSpecWithOptions(request, runtime);
}

model UpdateServiceUsageRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAYChudnQUoBH+mGWFpb6oP0='),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-39f4f251e94843xxxxxx'),
  userInformation?: map[string]string(name='UserInformation', description='The information about the applicant.'),
}

model UpdateServiceUsageShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The **token** can contain only ASCII characters and cannot exceed 64 characters in length.', example='AAAAAYChudnQUoBH+mGWFpb6oP0='),
  serviceId?: string(name='ServiceId', description='The service ID.

This parameter is required.', example='service-39f4f251e94843xxxxxx'),
  userInformationShrink?: string(name='UserInformation', description='The information about the applicant.'),
}

model UpdateServiceUsageResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
}

model UpdateServiceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceUsageResponseBody(name='body'),
}

/**
 * @summary Updates the application for using a service.
 *
 * @param tmpReq UpdateServiceUsageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceUsageResponse
 */
async function updateServiceUsageWithOptions(tmpReq: UpdateServiceUsageRequest, runtime: $RuntimeOptions): UpdateServiceUsageResponse {
  tmpReq.validate();
  var request = new UpdateServiceUsageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.userInformation)) {
    request.userInformationShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userInformation, 'UserInformation', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!$isNull(request.userInformationShrink)) {
    query['UserInformation'] = request.userInformationShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServiceUsage',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the application for using a service.
 *
 * @param request UpdateServiceUsageRequest
 * @return UpdateServiceUsageResponse
 */
async function updateServiceUsage(request: UpdateServiceUsageRequest): UpdateServiceUsageResponse {
  var runtime = new $RuntimeOptions{};
  return updateServiceUsageWithOptions(request, runtime);
}

model UpdateUserInformationRequest {
  deliverySettings?: {
    actiontrailDeliveryToOssEnabled?: boolean(name='ActiontrailDeliveryToOssEnabled', description='Specifies whether to enable screencast delivery to OSS. Valid values:

*   true
*   false', example='true'),
    ossBucketName?: string(name='OssBucketName', description='The name of the OSS bucket.', example='"mybucket"'),
    ossEnabled?: boolean(name='OssEnabled', description='Specifies whether to enable screencast delivery to Object Storage Service (OSS). Valid values:

*   true
*   false', example='true'),
    ossExpirationDays?: long(name='OssExpirationDays', description='The number of days for which the screencasts are saved.', example='7'),
    ossPath?: string(name='OssPath', description='The OSS path.', example='"path1/path2/"'),
  }(name='DeliverySettings', description='The modified delivery settings.'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateUserInformationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='51945B04-6AA6-410D-93BA-236E0248B104'),
}

model UpdateUserInformationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserInformationResponseBody(name='body'),
}

/**
 * @summary Updates the information about a customer.
 *
 * @param request UpdateUserInformationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserInformationResponse
 */
async function updateUserInformationWithOptions(request: UpdateUserInformationRequest, runtime: $RuntimeOptions): UpdateUserInformationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deliverySettings)) {
    query['DeliverySettings'] = request.deliverySettings;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateUserInformation',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the information about a customer.
 *
 * @param request UpdateUserInformationRequest
 * @return UpdateUserInformationResponse
 */
async function updateUserInformation(request: UpdateUserInformationRequest): UpdateUserInformationResponse {
  var runtime = new $RuntimeOptions{};
  return updateUserInformationWithOptions(request, runtime);
}

model UpgradeServiceInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: string(name='DryRun', description='Specifies whether to perform only a dry run for the request to check information such as the permissions and instance status. Valid values:

*   **true**: performs a dry run for the request, but does not upgrade service instance.
*   **false**: performs a dry run for the request, and upgrade service instance if the request passes the dry run.', example='true'),
  parameters?: map[string]any(name='Parameters', description='The parameters required for the upgrade. This parameter is required if the destination version of the service has new parameters.', example='{ \\\\"RegionId\\\\": \\\\"cn-hangzhou\\\\", \\\\"InstanceType\\\\": \\\\"ecs.g5.large\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4bxxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The destination version.', example='2'),
}

model UpgradeServiceInstanceShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: string(name='DryRun', description='Specifies whether to perform only a dry run for the request to check information such as the permissions and instance status. Valid values:

*   **true**: performs a dry run for the request, but does not upgrade service instance.
*   **false**: performs a dry run for the request, and upgrade service instance if the request passes the dry run.', example='true'),
  parametersShrink?: string(name='Parameters', description='The parameters required for the upgrade. This parameter is required if the destination version of the service has new parameters.', example='{ \\\\"RegionId\\\\": \\\\"cn-hangzhou\\\\", \\\\"InstanceType\\\\": \\\\"ecs.g5.large\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  serviceInstanceId?: string(name='ServiceInstanceId', description='The ID of the service instance.', example='si-d6ab3a63ccbb4bxxxxxx'),
  serviceVersion?: string(name='ServiceVersion', description='The destination version.', example='2'),
}

model UpgradeServiceInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4DB0F536-B3BE-4F0D-BD29-E83FB56D550C'),
  upgradeRequiredParameters?: [ string ](name='UpgradeRequiredParameters', description='The parameters required for the upgrade. This parameter is returned only if DryRun is set to true in the request. You can specify the required parameters based on the returned value when you perform an actual request.'),
}

model UpgradeServiceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeServiceInstanceResponseBody(name='body'),
}

/**
 * @summary Upgrades the version of a service instance.
 *
 * @param tmpReq UpgradeServiceInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeServiceInstanceResponse
 */
async function upgradeServiceInstanceWithOptions(tmpReq: UpgradeServiceInstanceRequest, runtime: $RuntimeOptions): UpgradeServiceInstanceResponse {
  tmpReq.validate();
  var request = new UpgradeServiceInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceInstanceId)) {
    query['ServiceInstanceId'] = request.serviceInstanceId;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpgradeServiceInstance',
    version = '2021-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Upgrades the version of a service instance.
 *
 * @param request UpgradeServiceInstanceRequest
 * @return UpgradeServiceInstanceResponse
 */
async function upgradeServiceInstance(request: UpgradeServiceInstanceRequest): UpgradeServiceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return upgradeServiceInstanceWithOptions(request, runtime);
}

